rcube_result_thread

Class for accessing IMAP's THREAD result

package

Framework

subpackage

Storage

Methods

Object constructor.

__construct( $mailbox = null,  $data = null) 

Arguments

$mailbox

$data

Converts part of the raw thread into an array

build_thread( $items,  $level = 1,  &$pos) 

Arguments

$items

$level

$pos

Creates 'depth' and 'children' arrays from stored thread 'tree' data.

build_thread_data( $data,  &$depth,  &$children,  $level) 

Arguments

$data

$depth

$children

$level

Returns number of elements (threads) in the result

count() : integer

Response

integer

Number of elements

Returns number of all messages in the result

count_messages() : integer

Response

integer

Number of elements

Check if the given message ID exists in the object

exists(integer $msgid, boolean $get_index = false) : boolean

Arguments

$msgid

integer

Message ID

$get_index

boolean

When enabled element's index will be returned. Elements are indexed starting with 0

Response

boolean

True on success, False if message ID doesn't exist

Filters data set. Removes threads not listed in $roots list.

filter(array $roots) 

Arguments

$roots

array

List of IDs of thread roots.

Return IDs of all messages in the result. Threaded data will be flattened.

get() : array

Response

array

List of message identifiers

Return all messages in the result.

get_compressed() : array

Response

array

List of message identifiers

Return result element at specified index (all messages, not roots)

get_element(integer|string $index) : integer

Arguments

$index

integer|string

Element's index or "FIRST" or "LAST"

Response

integer

Element value

Returns response parameters e.g. MAILBOX, ORDER

get_parameters(string $param = null) : array|string

Arguments

$param

string

Parameter name

Response

array|string

Response parameters or parameter value

Returns thread depth and children data

get_thread_data() : array

Response

array

Thread data

Returns data as tree

get_tree() : array

Response

array

Data tree

Initializes object with IMAP command response

init(string $data = null) 

Arguments

$data

string

IMAP response string

Checks if the result is empty

is_empty() : boolean

Response

boolean

True if the result is empty, False otherwise

Checks the result from IMAP command

is_error() : boolean

Response

boolean

True if the result is an error, False otherwise

Returns maximum message identifier in the result

max() : integer

Response

integer

Maximum message identifier

Returns minimum message identifier in the result

min() : integer

Response

integer

Minimum message identifier

IMAP THREAD response parser

parse_thread( $str,  $begin,  $end,  $depth) 

Arguments

$str

$begin

$end

$depth

Reverts order of elements in the result

revert() 

Slices data set.

slice( $offset,  $length) 

Arguments

$offset

Offset (as for PHP's array_slice())

$length

Number of elements (as for PHP's array_slice())

THREAD=REFS sorting implementation (based on provided index)

sort(\rcube_result_index $index) 

Arguments

$index

\rcube_result_index

Sorted message identifiers

Constants

SEPARATOR_ELEMENT

SEPARATOR_ELEMENT

SEPARATOR_ITEM

SEPARATOR_ITEM

SEPARATOR_LEVEL

SEPARATOR_LEVEL

Properties

incomplete

incomplete : 

Type(s)

raw_data

raw_data : 

Type(s)

mailbox

mailbox : 

Type(s)

meta

meta : 

Type(s)

order

order : 

Type(s)