Constants

UIDVALIDITY

UIDVALIDITY

UIDNEXT

UIDNEXT

HIGHESTMODSEQ

HIGHESTMODSEQ

MESSAGES

MESSAGES

VERSION

VERSION

COMPRESSION_LIMIT

COMPRESSION_LIMIT

Properties

$haveInitialSync

$haveInitialSync : boolean

Flag for indicating we have an initial sync for this collection.

Type

boolean

$_status

$_status : array

The folder's current internal property state.

Type

array

$_serverid

$_serverid : string

The backend server id for this folder.

Type

string

$_class

$_class : string

The collection class.

Type

string

$_lastSinceDate

$_lastSinceDate : integer

Timestamp for the last sincedate used for SOFTDELETE.

Type

integer

$_softDelete

$_softDelete : integer

Timestamp for the last time we performed a SOFTDELETE

Type

integer

$_messages

$_messages : array

The folder's current message list.

Note: This represents the folder list on the client and is affected by the FILTERTYPE on the collection.

Type

array

$_added

$_added : array

Internal cache of message UIDs that have been added since last sync.

Used for transporting changes back to activesync.

Type

array

$_changed

$_changed : array

Internal cache of message UIDs that have been modified on the server since the last sync. Used for transporting changes back to activesync.

Type

array

$_removed

$_removed : array

Internal cache of message UIDs that have been expunged from the IMAP server since last sync. Used for transporting changes back to activesync.

Type

array

$_softDeleted

$_softDeleted : array

Array of messages to be SOFTDELETEd from client. Only used when we have a CONDSTORE server available, otherwise we calculate the uid list based on the cached data.

Type

array

$_flags

$_flags : array

Internal cache of message flag changes. Should be one entry for each UID also listed in the $_changed array. Used for transporting changes back to activesync. An array keyed by message UID: uid => array('read' => 1)

Type

array

$_categories

$_categories : array

Internal cache of custom message flags (i.e., categories). Should contain one entry for each UID listed in the $_changed array. An array keyed on message UID: uid => array('TestOne', 'TestTwo')

Type

array

$_primed

$_primed : boolean

Internal flag to indicate initial first sync/prime.

Type

boolean

Methods

__construct()

__construct(string  $serverid, string  $class, array  $status = array()) 

Const'r

Parameters

string $serverid

The backend serverid of this folder.

string $class

The collection class.

array $status

Internal folder state.

serverid()

serverid() : string

Return the serverid for this collection.

Returns

string —

The serverid.

setServerId()

setServerId(string  $id) 

Set a new value for the serverid.

Parameters

string $id

The new id.

collectionClass()

collectionClass() : string

Return the collection class for this collection.

Returns

string —

The collection class.

setStatus()

setStatus(array  $status) 

Set the status for this collection.

Parameters

array $status

setSoftDeleteTimes()

setSoftDeleteTimes(\long  $sincedate, \long  $ts) 

Set the last softdelete timestamps used.

Parameters

\long $sincedate

The sincedate used in the last softdelete check.

\long $ts

Time the softdelete check was performed.

getSoftDeleteTimes()

getSoftDeleteTimes() : array

Return the softdelete timestamps.

Returns

array —

An array with the last sincedate in the 0 element and the last timestamp in the 1 element.

updateState()

updateState() 

Updates the internal UID cache if needed and clears the internal update/deleted/changed cache. To be called after all changes have been dealt with by the activesync client.

setChanges()

setChanges(array  $messages, array  $flags = array(), array  $categories = array(), boolean  $resetMinUid = false) 

Set message changes.

Parameters

array $messages

An array of message UIDs.

array $flags

A hash of message read flags, keyed by UID.

array $categories

A hash of custom message flags, keyed by UID. @since 2.17.0

boolean $resetMinUid

If true, reset the minimum UID. Should be used when FilterType has widened and messages older than originally selected are being returned. @since 2.24.0

primeFolder()

primeFolder(array  $messages) 

Sets initial message collection for servers that support MODSEQ. Much more effecient than using setChanges() when we know this is the initial folder "priming".

Parameters

array $messages

Array of message UIDs for the initial message set for this folder.

getSoftDeleted()

getSoftDeleted() : array

Return a list of message uids that should be SOFTDELETEd from the client.

Must be called after setChanges and setRemoved, but before updateState.

Returns

array

setSoftDeleted()

setSoftDeleted(array  $softDeleted) 

Set the list of uids to be SOFTDELETEd. Only needed for CONDSTORE servers.

Parameters

array $softDeleted

The message UID list.

checkValidity()

checkValidity(array  $params = array()) 

Check the validity of various values.

Parameters

array $params

A status array containing status to check.

Throws

\Horde_ActiveSync_Exception_StaleState

setRemoved()

setRemoved(array  $uids) 

Set the list of expunged message UIDs.

Parameters

array $uids

An array of message UIDs that have been expunged.

Throws

\Horde_ActiveSync_Exception_StaleState

uidvalidity()

uidvalidity() : string|boolean

Return the folder's UID validity.

Returns

string|boolean —

The folder UID validity marker, or false if not set.

uidnext()

uidnext() : string

Return the folder's next UID number.

Returns

string —

The next UID number.

modseq()

modseq() : string

Return the folder's MODSEQ value.

Returns

string —

The MODSEQ number.

total_messages()

total_messages() : integer

Return the total, unfiltered number of messages in the folder.

Returns

integer —

The total number of messages.

messages()

messages() : array

Return the list of UIDs currently on the device.

Returns

array —

The list of backend messages.

flags()

flags() : array

Return the internal message flags changes cache.

Returns

array —

The array of message flag changes.

categories()

categories() : array

Return the internal message category cache.

Returns

array —

The array of message categories. @see self::$_categories

added()

added() : array

Return the list of UIDs that need to be added to the device.

Returns

array —

The list of UIDs.

changed()

changed() : array

Return the list of UIDs that need to have flag changes sent to the device

Returns

array —

The list of UIDs.

removed()

removed() : array

Return the list of UIDs that need to be removed from the device.

Returns

array —

The list of UIDs.

minuid()

minuid() : integer

Return the minimum IMAP UID contained in this folder.

Returns

integer —

The IMAP UID.

serialize()

serialize() : string

Serialize this object.

Returns

string —

The serialized data.

unserialize()

unserialize(string  $data) 

Reconstruct the object from serialized data.

Parameters

string $data

The serialized data.

Throws

\Horde_ActiveSync_Exception_StaleState

__toString()

__toString() : string

Convert the instance into a string.

Returns

string —

The string representation for this instance.

_toSequenceString()

_toSequenceString(array  $ids) : string

Create an IMAP message sequence string from a list of indices.

Index Format: range_start:range_end,uid,uid2,...

Parameters

array $ids

An array of UIDs.

Returns

string —

The IMAP message sequence string.

_fromSequenceString()

_fromSequenceString(string  $str) : array

Parse an IMAP message sequence string into a list of indices.

Parameters

string $str

The IMAP message sequence string.

Returns

array —

An array of indices.