PHP Class IMP_Mailbox_List, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements Countable, implements Iterator, implements Serializable
Exibir arquivo Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$changed boolean Has the internal message list changed?
$headersUsed array The list of headers used by this class.

Protected Properties

Property Type Description
$_buidmax integer Max assigned browser-UID.
$_buids array Mapping of browser-UIDs to UIDs.
$_cacheid string The IMAP cache ID of the mailbox.
$_mailbox IMP_Mailbox The mailbox to work with.
$_sorted array The array of sorted indices.
$_thread array The thread object representation(s) for the mailbox.
$_threadui array The thread tree UI cached data.

Public Methods

Method Description
__construct ( string $mbox ) Constructor.
count ( ) : integer Returns the current message count of the mailbox.
current ( ) : array
getArrayIndex ( integer $uid, string $mbox = null ) : mixed Returns the array index of the given message UID.
getBuid ( string $mbox, integer $uid ) : integer Create a browser-UID from a mail UID.
getFullThread ( integer $uid, string $mbox = null ) : IMP_Indices Returns the list of UIDs for an entire thread given one message in that thread.
getIndicesOb ( ) : IMP_Indices Generate an IMP_Indices object out of the contents of this mailbox.
getMailboxArray ( array $msgnum ) : array Build the array of message information.
getThreadOb ( integer $offset ) : IMP_Mailbox_List_Thread Returns a thread object for a message.
key ( ) : integer
mailboxStart ( integer $total ) : integer Determines the sequence number of the first message to display, based on the user's preferences.
next ( )
offsetExists ( integer $offset )
offsetGet ( integer $offset ) : array
offsetSet ( $offset, $value )
offsetUnset ( $offset )
rebuild ( boolean $reset = false ) Rebuilds/resets the mailbox list.
resolveBuid ( integer $buid ) : array Resolve a mail UID from a browser-UID.
rewind ( )
serialize ( ) : string Serialization.
unseenMessages ( integer $results, array $opts = [] ) : mixed Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with UNDELETED if we're hiding deleted messages).
unserialize ( string $data ) Unserialization.
valid ( )

Protected Methods

Method Description
_buildMailbox ( ) Builds the sorted list of messages in the mailbox.
_buildMailboxProcess ( IMP_Mailbox $mbox, array $sorted ) : array Run after the initial mailbox search is completed.
_buildMailboxQuery ( )
_getMbox ( integer $id ) : IMP_Mailbox Get the mailbox for a sequence ID.
_getThread ( string $mbox, array $extra = [] ) : Horde_Imap_Client_Data_Thread Returns the thread object for a mailbox.
_serialize ( )
_unserialize ( $data )

Method Details

__construct() public method

Constructor.
public __construct ( string $mbox )
$mbox string The mailbox to work with.

_buildMailbox() protected method

Builds the sorted list of messages in the mailbox.
protected _buildMailbox ( )

_buildMailboxProcess() protected method

Run after the initial mailbox search is completed.
protected _buildMailboxProcess ( IMP_Mailbox $mbox, array $sorted ) : array
$mbox IMP_Mailbox Mailbox searched.
$sorted array Sorted list of UIDs.
return array Sorted list of UIDs.

_buildMailboxQuery() protected method

protected _buildMailboxQuery ( )

_getMbox() protected method

Get the mailbox for a sequence ID.
protected _getMbox ( integer $id ) : IMP_Mailbox
$id integer Sequence ID.
return IMP_Mailbox The mailbox.

_getThread() protected method

Returns the thread object for a mailbox.
protected _getThread ( string $mbox, array $extra = [] ) : Horde_Imap_Client_Data_Thread
$mbox string The mailbox.
$extra array Extra options to pass to IMAP thread() command.
return Horde_Imap_Client_Data_Thread Thread object.

_serialize() protected method

protected _serialize ( )

_unserialize() protected method

protected _unserialize ( $data )

count() public method

Returns the current message count of the mailbox.
public count ( ) : integer
return integer The mailbox message count.

current() public method

public current ( ) : array
return array Two-element array: - m: (IMP_Mailbox) Mailbox of message. - u: (string) UID of message.

getArrayIndex() public method

Returns the array index of the given message UID.
public getArrayIndex ( integer $uid, string $mbox = null ) : mixed
$uid integer The message UID.
$mbox string The message mailbox (defaults to the current mailbox).
return mixed The array index of the location of the message UID in the current mailbox. Returns null if not found.

getBuid() public method

Create a browser-UID from a mail UID.
public getBuid ( string $mbox, integer $uid ) : integer
$mbox string The mailbox.
$uid integer UID.
return integer Browser-UID.

getFullThread() public method

Returns the list of UIDs for an entire thread given one message in that thread.
public getFullThread ( integer $uid, string $mbox = null ) : IMP_Indices
$uid integer The message UID.
$mbox string The message mailbox (defaults to the current mailbox).
return IMP_Indices An indices object.

getIndicesOb() public method

Generate an IMP_Indices object out of the contents of this mailbox.
public getIndicesOb ( ) : IMP_Indices
return IMP_Indices An indices object.

getMailboxArray() public method

Build the array of message information.
public getMailboxArray ( array $msgnum ) : array
$msgnum array An array of index numbers.
return array An array with the following keys:
  - overview: (array) The overview information. Contains the following:
    - envelope: (Horde_Imap_Client_Data_Envelope) Envelope information
                returned from the IMAP server.
    - flags: (array) The list of IMAP flags returned from the server.
    - headers: (array) Horde_Mime_Headers objects containing header
               data for non-envelope headers.
    - idx: (integer) Array index of this message.
    - mailbox: (string) The mailbox containing the message.
    - size: (integer) The size of the message in bytes.
    - uid: (string) The unique ID of the message.
  - uids: (IMP_Indices) An indices object.

getThreadOb() public method

Returns a thread object for a message.
public getThreadOb ( integer $offset ) : IMP_Mailbox_List_Thread
$offset integer Sequence number of message.
return IMP_Mailbox_List_Thread The thread object.

key() public method

public key ( ) : integer
return integer Sequence number of message.

mailboxStart() public method

Determines the sequence number of the first message to display, based on the user's preferences.
public mailboxStart ( integer $total ) : integer
$total integer The total number of messages in the mailbox.
return integer The sequence number in the sorted mailbox.

next() public method

public next ( )

offsetExists() public method

public offsetExists ( integer $offset )
$offset integer Sequence number of message.

offsetGet() public method

public offsetGet ( integer $offset ) : array
$offset integer Sequence number of message.
return array Two-element array: - m: (IMP_Mailbox) Mailbox of message. - u: (string) UID of message.

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

rebuild() public method

Rebuilds/resets the mailbox list.
public rebuild ( boolean $reset = false )
$reset boolean If true, resets the list instead of rebuilding.

resolveBuid() public method

Resolve a mail UID from a browser-UID.
public resolveBuid ( integer $buid ) : array
$buid integer Browser-UID.
return array Two-element array: - m: (IMP_Mailbox) Mailbox of message. - u: (string) UID of message.

rewind() public method

public rewind ( )

serialize() public method

Serialization.
public serialize ( ) : string
return string Serialized data.

unseenMessages() public method

Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with UNDELETED if we're hiding deleted messages).
public unseenMessages ( integer $results, array $opts = [] ) : mixed
$results integer A Horde_Imap_Client::SEARCH_RESULTS_* constant that indicates the desired return type.
$opts array Additional options: - sort: (array) List of sort criteria to use. - uids: (boolean) Return UIDs instead of sequence numbers (for $results queries that return message lists). DEFAULT: false
return mixed Whatever is requested in $results.

unserialize() public method

Unserialization.
public unserialize ( string $data )
$data string Serialized data.

valid() public method

public valid ( )

Property Details

$_buidmax protected_oe property

Max assigned browser-UID.
protected int $_buidmax
return integer

$_buids protected_oe property

Mapping of browser-UIDs to UIDs.
protected array $_buids
return array

$_cacheid protected_oe property

The IMAP cache ID of the mailbox.
protected string $_cacheid
return string

$_mailbox protected_oe property

The mailbox to work with.
protected IMP_Mailbox $_mailbox
return IMP_Mailbox

$_sorted protected_oe property

The array of sorted indices.
protected array $_sorted
return array

$_thread protected_oe property

The thread object representation(s) for the mailbox.
protected array $_thread
return array

$_threadui protected_oe property

The thread tree UI cached data.
protected array $_threadui
return array

$changed public_oe property

Has the internal message list changed?
public bool $changed
return boolean

$headersUsed public_oe static_oe property

The list of headers used by this class.
public static array $headersUsed
return array