rcube_result_index

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

package

Framework

subpackage

Storage

Methods

Object constructor.

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

Arguments

$mailbox

$data

$order

Returns number of elements in the result

count() : integer

Response

integer

Number of elements

Returns number of elements in the result.

count_messages() : integer

Alias for count() for compatibility with rcube_result_thread

Response

integer

Number of elements

Check if the given message ID exists in the object

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

Arguments

$msgid

integer

Message ID

$get_index

boolean

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

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

filter(array $ids = array()) 

Arguments

$ids

array

List of IDs to remove.

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(integer|string $index) : integer

Arguments

$index

integer|string

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

Response

integer

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

Initializes object with SORT 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 length of internal data representation

length() : integer

Response

integer

Data length

Returns maximal message identifier in the result

max() : integer

Response

integer

Maximal message identifier

Returns minimal message identifier in the result

min() : integer

Response

integer

Minimal message identifier

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

Constants

SEPARATOR_ELEMENT

SEPARATOR_ELEMENT

Properties

incomplete

incomplete : 

Type(s)

raw_data

raw_data : 

Type(s)

mailbox

mailbox : 

Type(s)

meta

meta : 

Type(s)

params

params : 

Type(s)

order

order : 

Type(s)