Properties

$

$ : array

html An array describing the text/html part with:

  • 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.

Type

array

$

$ : array

plain An array describing the text/plain part with:

  • 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.

Type

array

$

$ : array

bodyPart An array describing the BODYPART requested. BODYPART is typically a truncated text/html representation of part of the message. Very few clients request this.

  • 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.

Type

array

$_options

$_options : array

Type

array

$_version

$_version : float

Type

float

$_mbox

$_mbox : \Horde_Imap_Client_Mailbox

Type

\Horde_Imap_Client_Mailbox

$_uid

$_uid : integer

Type

integer

$_plain

$_plain : array

Type

array

$_html

$_html : array

Type

array

$_bodyPart

$_bodyPart : array

Type

array

$_validatedPlain

$_validatedPlain : boolean

Flag to indicate self::$_Plain is validated.

Type

boolean

$_validatedHtml

$_validatedHtml : boolean

Flag to indicate self::$_html is validated.

Type

boolean

Methods

__construct()

__construct(array  $params, array  $options) 

Const'r

Parameters

array $params

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.
array $options

The options array.

__destruct()

__destruct() 

__get()

__get(  $property) 

Parameters

$property

__set()

__set(  $property,   $value) 

Parameters

$property
$value

getBodyTypePreference()

getBodyTypePreference(  $save_bandwidth = false) : integer

Return the BODYTYPE to return to the client. Takes BODYPREF and available parts into account.

Parameters

$save_bandwidth

Returns

integer —

A Horde_ActiveSync::BODYPREFTYPE* constant.

plainBody()

plainBody() : array

Return the validated text/plain body data.

Returns

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.

htmlBody()

htmlBody() : array

Return the validated text/html body data.

Returns

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.

bodyPartBody()

bodyPartBody() : array

Return the validated BODYPART data.

Returns

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()

toArray() : array

Return the body data in array format. Needed for BC.

Returns

array

_getParts()

_getParts() 

Determine which parts we need, and fetches them from the IMAP client.

Takes into account the available parts and the BODYPREF/BODYPARTPREF options.

_wantHtml()

_wantHtml() : boolean

Return if we want HTML data.

Returns

boolean —

True if HTML data is needed.

_wantPlainText()

_wantPlainText(string  $html_id, boolean  $want_html) : boolean

Return if we want plain text data.

Parameters

string $html_id

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.

boolean $want_html

True if the client wants HTML.

Returns

boolean —

True if plain data is needed.

_fetchData()

_fetchData(array  $params) : \Horde_Imap_Client_Data_Fetch

Fetch data from the IMAP client.

Parameters

array $params

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.

Throws

\Horde_ActiveSync_Exception,

Horde_ActiveSync_Exception_EmailFatalFailure

Returns

\Horde_Imap_Client_Data_Fetch —

The results.

_getPlainPart()

_getPlainPart(\Horde_Imap_Client_Data_Fetch  $data, \Horde_Mime_Part  $text_mime) : array

Build the data needed for the plain part.

Parameters

\Horde_Imap_Client_Data_Fetch $data

The FETCH results.

\Horde_Mime_Part $text_mime

The plaintext MIME part.

Returns

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.

_getHtmlPart()

_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.

Parameters

\Horde_Imap_Client_Data_Fetch $data

FETCH results.

\Horde_Mime_Part $html_mime

The text/html MIME part.

boolean $convert_to_plain

Convert text to plain text also? If true, will also return a 'plain' array.

Returns

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.

_getBodyPart()

_getBodyPart(\Horde_Imap_Client_Data_Fetch  $data, \Horde_Mime_Part  $mime, boolean  $to_html) : array

Build the data needed for the BodyPart part.

Parameters

\Horde_Imap_Client_Data_Fetch $data

The FETCH results.

\Horde_Mime_Part $mime

The plaintext MIME part.

boolean $to_html

If true, $id is assumed to be a text/plain part and is converted to html.

Returns

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.

_validateBodyData()

_validateBodyData(array  $data) : array

Validate the body data to ensure consistent EOL and UTF8 data. Returns body data in a stream object.

Parameters

array $data

The body data. @see self::_bodyPartText() for structure.

Returns

array —

The validated body data array. @see self::_bodyPartText()