PHP Class Horde_ActiveSync_Imap_MessageBodyData, horde

Author: Michael J Rubinsky ([email protected])
Mostrar archivo Open project: horde/horde

Protected Properties

Property Type Description
$_basePart Horde_ActiveSync_Mime
$_bodyPart array
$_html array
$_imap Horde_ActiveSync_Imap_Adapter
$_mbox Horde_Imap_Client_Mailbox
$_options array
$_plain arary
$_uid integer
$_validatedHtml boolean Flag to indicate self::$_html is validated.
$_validatedPlain boolean Flag to indicate self::$_Plain is validated.
$_version float

Public Methods

Method Description
__construct ( array $params, array $options ) Const'r
__destruct ( )
__get ( $property )
__set ( $property, $value )
bodyPartBody ( ) : array Return the validated BODYPART data.
getBodyTypePreference ( $save_bandwidth = false ) : integer Return the BODYTYPE to return to the client. Takes BODYPREF and available parts into account.
htmlBody ( ) : array Return the validated text/html body data.
plainBody ( ) : array Return the validated text/plain body data.
toArray ( ) : array Return the body data in array format. Needed for BC.

Protected Methods

Method Description
_fetchData ( array $params ) : Horde_Imap_Client_Data_Fetch Fetch data from the IMAP client.
_getBodyPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $mime, boolean $to_html ) : array Build the data needed for the BodyPart part.
_getHtmlPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $html_mime, boolean $convert_to_plain ) : array Build the data needed for the html part.
_getParts ( ) Determine which parts we need, and fetches them from the IMAP client.
_getPlainPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $text_mime ) : array Build the data needed for the plain part.
_validateBodyData ( array &$data ) : array Validate the body data to ensure consistent EOL and UTF8 data. Returns body data in a stream object.
_wantHtml ( ) : boolean Return if we want HTML data.
_wantPlainText ( string $html_id, boolean $want_html ) : boolean Return if we want plain text data.

Method Details

__construct() public method

Const'r
public __construct ( array $params, array $options )
$params array Parameters: - imap: (Horde_Imap_Client_Base) The IMAP client. - mbox: (Horde_Imap_Client_Mailbox) The mailbox. - uid: (integer) The message UID. - mime: (Horde_ActiveSync_Mime) The MIME object.
$options array The options array.

__destruct() public method

public __destruct ( )

__get() public method

public __get ( $property )

__set() public method

public __set ( $property, $value )

_fetchData() protected method

Fetch data from the IMAP client.
protected _fetchData ( array $params ) : Horde_Imap_Client_Data_Fetch
$params array Parameter array. - html_id (string) The MIME id of the HTML part, if any. - text_id (string) The MIME id of the plain part, if any.
return Horde_Imap_Client_Data_Fetch The results.

_getBodyPart() protected method

Build the data needed for the BodyPart part.
protected _getBodyPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $mime, boolean $to_html ) : array
$data Horde_Imap_Client_Data_Fetch The FETCH results.
$mime Horde_Mime_Part The plaintext MIME part.
$to_html boolean If true, $id is assumed to be a text/plain part and is converted to html.
return array The BodyPart data. - charset: (string) The charset of the text. - body: (string) The body text. - truncated: (boolean) True if text was truncated. - size: (integer) The original part size, in bytes.

_getHtmlPart() protected method

Build the data needed for the html part.
protected _getHtmlPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $html_mime, boolean $convert_to_plain ) : array
$data Horde_Imap_Client_Data_Fetch FETCH results.
$html_mime Horde_Mime_Part The text/html MIME part.
$convert_to_plain boolean Convert text to plain text also? If true, will also return a 'plain' array.
return array An array containing 'html' and if $convert_to_true is set, a 'plain' part as well. @see self::_getPlainPart for structure of each entry.

_getParts() protected method

Takes into account the available parts and the BODYPREF/BODYPARTPREF options.
protected _getParts ( )

_getPlainPart() protected method

Build the data needed for the plain part.
protected _getPlainPart ( Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $text_mime ) : array
$data Horde_Imap_Client_Data_Fetch The FETCH results.
$text_mime Horde_Mime_Part The plaintext MIME part.
return array The plain part data. - charset: (string) The charset of the text. - body: (string) The body text. - truncated: (boolean) True if text was truncated. - size: (integer) The original part size, in bytes.

_validateBodyData() protected method

Validate the body data to ensure consistent EOL and UTF8 data. Returns body data in a stream object.
protected _validateBodyData ( array &$data ) : array
$data array The body data. @see self::_bodyPartText() for structure.
return array The validated body data array. @see self::_bodyPartText()

_wantHtml() protected method

Return if we want HTML data.
protected _wantHtml ( ) : boolean
return boolean True if HTML data is needed.

_wantPlainText() protected method

Return if we want plain text data.
protected _wantPlainText ( string $html_id, boolean $want_html ) : boolean
$html_id string The MIME id of any HTML part, if available. Used to detect if we need to fetch the plain part if we are requesting HTML, but only have plain.
$want_html boolean True if the client wants HTML.
return boolean True if plain data is needed.

bodyPartBody() public method

Return the validated BODYPART data.
public bodyPartBody ( ) : array
return array The validated body data array: - charset: (string) The charset of the text. - body: (Horde_Stream) The body text in a stream. - truncated: (boolean) True if text was truncated. - size: (integer) The original part size, in bytes.

getBodyTypePreference() public method

Return the BODYTYPE to return to the client. Takes BODYPREF and available parts into account.
public getBodyTypePreference ( $save_bandwidth = false ) : integer
return integer A Horde_ActiveSync::BODYPREF_TYPE_* constant.

htmlBody() public method

Return the validated text/html body data.
public htmlBody ( ) : array
return array The validated body data array: - charset: (string) The charset of the text. - body: (Horde_Stream) The body text in a stream. - truncated: (boolean) True if text was truncated. - size: (integer) The original part size, in bytes.

plainBody() public method

Return the validated text/plain body data.
public plainBody ( ) : array
return array The validated body data array: - charset: (string) The charset of the text. - body: (Horde_Stream) The body text in a stream. - truncated: (boolean) True if text was truncated. - size: (integer) The original part size, in bytes.

toArray() public method

Return the body data in array format. Needed for BC.
public toArray ( ) : array
return array

Property Details

$_basePart protected_oe property

protected Horde_ActiveSync_Mime $_basePart
return Horde_ActiveSync_Mime

$_bodyPart protected_oe property

protected array $_bodyPart
return array

$_html protected_oe property

protected array $_html
return array

$_imap protected_oe property

protected Horde_ActiveSync_Imap_Adapter $_imap
return Horde_ActiveSync_Imap_Adapter

$_mbox protected_oe property

protected Horde_Imap_Client_Mailbox $_mbox
return Horde_Imap_Client_Mailbox

$_options protected_oe property

protected array $_options
return array

$_plain protected_oe property

protected arary $_plain
return arary

$_uid protected_oe property

protected int $_uid
return integer

$_validatedHtml protected_oe property

Flag to indicate self::$_html is validated.
protected bool $_validatedHtml
return boolean

$_validatedPlain protected_oe property

Flag to indicate self::$_Plain is validated.
protected bool $_validatedPlain
return boolean

$_version protected_oe property

protected float $_version
return float