Documentation

Horde_ActiveSync_Imap_MessageBodyData
in package

Tags
license

http://www.horde.org/licenses/gpl GPLv2

copyright

2012-2020 Horde LLC (http://www.horde.org)

author

Michael J Rubinsky mrubinsk@horde.org

Table of Contents

$  : array<string|int, mixed>
$  : array<string|int, mixed>
$  : array<string|int, mixed>
$  : bool|int
$_basePart  : Horde_ActiveSync_Mime
$_bodyPart  : array<string|int, mixed>
$_html  : array<string|int, mixed>
$_imap  : Horde_ActiveSync_Imap_Adapter
$_mbox  : Horde_Imap_Client_Mailbox
$_nativeType  : bool
The body part type of the original email if potentially different than the BODYPREF_TYPE that is being requested.
$_options  : array<string|int, mixed>
$_plain  : array<string|int, mixed>
$_uid  : int
$_validatedHtml  : bool
Flag to indicate self::$_html is validated.
$_validatedPlain  : bool
Flag to indicate self::$_Plain is validated.
$_version  : float
__construct()  : mixed
Const'r
__destruct()  : mixed
__get()  : mixed
__set()  : mixed
bodyPartBody()  : array<string|int, mixed>
Return the validated BODYPART data.
getBodyTypePreference()  : int
Return the BODYTYPE to return to the client. Takes BODYPREF and available parts into account.
htmlBody()  : array<string|int, mixed>
Return the validated text/html body data.
plainBody()  : array<string|int, mixed>
Return the validated text/plain body data.
toArray()  : array<string|int, mixed>
Return the body data in array format. Needed for BC.
_fetchData()  : Horde_Imap_Client_Data_Fetch
Fetch data from the IMAP client.
_getBodyPart()  : array<string|int, mixed>
Build the data needed for the BodyPart part.
_getHtmlPart()  : array<string|int, mixed>
Build the data needed for the html part.
_getHtmlPart2Plain()  : mixed
_getParts()  : mixed
Determine which parts we need, and fetches them from the IMAP client.
_getPlainPart()  : array<string|int, mixed>
Build the data needed for the plain part.
_getPlainPart2Html()  : array<string|int, mixed>
Get the text/plain part and convert it into text/html.
_plain2Html()  : array<string|int, mixed>
Helper method to convert, and possibly truncate text/plain body data into text/html data taking into account BODYPREF_TYPE_HTML truncation.
_validateBodyData()  : mixed
Validate the body data to ensure consistent EOL and UTF8 data. Returns body data in a stream object.
_wantHtml()  : bool
Return if we want HTML data.
_wantPlainText()  : bool
Return if we want plain text data.

Properties

$

public array<string|int, mixed> $

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.

$

public array<string|int, mixed> $

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.

$

public array<string|int, mixed> $

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.

$

public bool|int $

The Horde_ActiveSync::BODYPREF_TYPE of the original email on the server, or false if not able to be determined.

$_nativeType

The body part type of the original email if potentially different than the BODYPREF_TYPE that is being requested.

protected bool $_nativeType = \false

| integer False if not specified, otherwise a Horde_ActiveSync::BODYPREF_TYPE constant.

$_validatedHtml

Flag to indicate self::$_html is validated.

protected bool $_validatedHtml

$_validatedPlain

Flag to indicate self::$_Plain is validated.

protected bool $_validatedPlain

Methods

__construct()

Const'r

public __construct(array<string|int, mixed> $params, array<string|int, mixed> $options) : mixed
Parameters
$params : array<string|int, mixed>

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<string|int, mixed>

The options array.

Return values
mixed

__get()

public & __get(mixed $property) : mixed
Parameters
$property : mixed
Return values
mixed

__set()

public __set(mixed $property, mixed $value) : mixed
Parameters
$property : mixed
$value : mixed
Return values
mixed

bodyPartBody()

Return the validated BODYPART data.

public bodyPartBody() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

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

public getBodyTypePreference([mixed $save_bandwidth = false ]) : int
Parameters
$save_bandwidth : mixed = false
Return values
int

A Horde_ActiveSync::BODYPREF_TYPE_* constant.

htmlBody()

Return the validated text/html body data.

public htmlBody() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

Return the validated text/plain body data.

public plainBody() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

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

public toArray() : array<string|int, mixed>
Tags
todo

remove in H6.

Return values
array<string|int, mixed>

_fetchData()

Fetch data from the IMAP client.

protected _fetchData(array<string|int, mixed> $params) : Horde_Imap_Client_Data_Fetch
Parameters
$params : array<string|int, mixed>

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.
Tags
throws

Horde_ActiveSync_Exception, Horde_ActiveSync_Exception_EmailFatalFailure

Return values
Horde_Imap_Client_Data_Fetch

The results.

_getBodyPart()

Build the data needed for the BodyPart part.

protected _getBodyPart(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $mime, bool $to_html) : array<string|int, mixed>
Parameters
$data : Horde_Imap_Client_Data_Fetch

The FETCH results.

$mime : Horde_Mime_Part

The plaintext MIME part.

$to_html : bool

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

Return values
array<string|int, mixed>

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

Build the data needed for the html part.

protected _getHtmlPart(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $html_mime) : array<string|int, mixed>
Parameters
$data : Horde_Imap_Client_Data_Fetch

FETCH results.

$html_mime : Horde_Mime_Part

The text/html MIME part.

Return values
array<string|int, mixed>

An array containing the html data. @see self::_getPlainPart for structure.

_getHtmlPart2Plain()

protected _getHtmlPart2Plain(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $html_mime) : mixed
Parameters
$data : Horde_Imap_Client_Data_Fetch

FETCH results.

$html_mime : Horde_Mime_Part

The text/html MIME part.

Return values
mixed

_getParts()

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

protected _getParts() : mixed

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

Return values
mixed

_getPlainPart()

Build the data needed for the plain part.

protected _getPlainPart(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $text_mime) : array<string|int, mixed>
Parameters
$data : Horde_Imap_Client_Data_Fetch

The FETCH results.

$text_mime : Horde_Mime_Part

The plaintext MIME part.

Return values
array<string|int, mixed>

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.

_getPlainPart2Html()

Get the text/plain part and convert it into text/html.

protected _getPlainPart2Html(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $text_mime) : array<string|int, mixed>
Parameters
$data : Horde_Imap_Client_Data_Fetch

The FETCH results.

$text_mime : Horde_Mime_Part

The plaintext MIME part.

Return values
array<string|int, mixed>

The plain part data, converted to text/html.

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

_plain2Html()

Helper method to convert, and possibly truncate text/plain body data into text/html data taking into account BODYPREF_TYPE_HTML truncation.

protected _plain2Html(string $plain_text, string $charset) : array<string|int, mixed>
Parameters
$plain_text : string

The plain text body.

$charset : string

The charset.

Return values
array<string|int, mixed>

The text/html part data structure.

_validateBodyData()

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

protected _validateBodyData(array<string|int, mixed> &$data) : mixed
Parameters
$data : array<string|int, mixed>

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

Return values
mixed

_wantHtml()

Return if we want HTML data.

protected _wantHtml() : bool
Return values
bool

True if HTML data is needed.

_wantPlainText()

Return if we want plain text data.

protected _wantPlainText(string $html_id, bool $want_html) : bool
Parameters
$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 : bool

True if the client wants HTML.

Return values
bool

True if plain data is needed.

Search results