rcube_result_index

Class for accessing IMAP's SORT/SEARCH/ESEARCH result

package

Framework

subpackage

Storage

Methods

Object constructor.

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

Arguments

$mailbox

$data

Initializes object with SORT command response

init(string $data = null) 

Arguments

$data

string

IMAP response string

Checks the result from IMAP command

is_error() : bool

Response

bool

True if the result is an error, False otherwise

Checks if the result is empty

is_empty() : bool

Response

bool

True if the result is empty, False otherwise

Returns number of elements in the result

count() : int

Response

int

Number of elements

Returns number of elements in the result.

count_messages() : int

Alias for count() for compatibility with rcube_result_thread

Response

int

Number of elements

Returns maximal message identifier in the result

max() : int

Response

int

Maximal message identifier

Returns minimal message identifier in the result

min() : int

Response

int

Minimal message identifier

Slices data set.

slice(mixed $offset, mixed $length) 

Arguments

$offset

mixed

Offset (as for PHP's array_slice())

$length

mixed

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

Filters data set. Removes elements not listed in $ids list.

filter(array $ids = array()) 

Arguments

$ids

array

List of IDs to remove.

Reverts order of elements in the result

revert() 

Check if the given message ID exists in the object

exists(int $msgid, bool $get_index = false) : mixed

Arguments

$msgid

int

Message ID

$get_index

bool

When enabled element's index will be returned.

                   Elements are indexed starting with 0

Response

mixed

False if message ID doesn't exist, True if exists or

          index of the element if $get_index=true

Return all messages in the result.

get() : array

Response

array

List of message IDs

Return all messages in the result.

get_compressed() : array

Response

array

List of message IDs

Return result element at specified index

get_element(int|string $index) : int

Arguments

$index

int|string

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

Response

int

Element value

Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ or internal data 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 length of internal data representation

length() : int

Response

int

Data length

Constants

SEPARATOR_ELEMENT

SEPARATOR_ELEMENT

Properties

raw_data

raw_data : 

mailbox

mailbox : 

meta

meta : 

params

params : 

order

order :