IMP_Indices
in package
implements
ArrayAccess, Countable, Iterator
Object representing a list of message indices.
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- Iterator
Properties
- $_indices : array<string|int, mixed>
- The indices list.
Methods
- __construct() : mixed
- Constructor.
- __toString() : string
- String representation of the object.
- add() : mixed
- Add indices.
- copy() : bool
- Copies or moves a list of messages to a new mailbox.
- count() : int
- Index count.
- current() : mixed
- delete() : int|bool
- Deletes a list of messages.
- flag() : bool
- Sets or clears a given flag for a list of messages.
- getSingle() : bool
- Returns mailbox/UID information for the first index.
- indices() : array<string|int, mixed>
- Return a copy of the indices array.
- key() : mixed
- mdnCheck() : bool
- Check if we need to send a MDN, and send if needed.
- next() : mixed
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : mixed
- offsetUnset() : void
- rewind() : mixed
- stripPart() : IMP_Indices
- Strips one or all MIME parts out of a message.
- toArray() : array<string|int, mixed>
- Returns an array containing compressed UID values.
- valid() : mixed
- _fromSequenceString() : array<string|int, mixed>
- Parse an IMAP message sequence string into a list of indices.
- _toSequenceString() : string
- Create an IMAP message sequence string from a list of indices.
Properties
$_indices
The indices list.
protected
array<string|int, mixed>
$_indices
= array()
Methods
__construct()
Constructor.
public
__construct() : mixed
Parameters are the same as add().
Tags
__toString()
String representation of the object.
public
__toString() : string
Return values
string —String representation (IMAP sequence string).
add()
Add indices.
public
add() : mixed
Input format:
1 argument: ----------- + Array Either: KEYS: Mailbox names VALUES: UIDs -or- Horde_Imap_Client_Ids object -or- VALUES: IMAP sequence strings + IMP_Compose object + IMP_Contents object + IMP_Indices object + String Format: IMAP sequence string 2 arguments: ------------ 1st argument: Mailbox name -or- IMP_Mailbox object 2nd argument: Either a single UID, array of UIDs, or a Horde_Imap_Client_Ids object.
copy()
Copies or moves a list of messages to a new mailbox.
public
copy(string $targetMbox, string $action[, array<string|int, mixed> $opts = array() ]) : bool
Also handles moves to the tasklist and/or notepad applications.
Parameters
- $targetMbox : string
-
The mailbox to move/copy messages to (UTF-8).
- $action : string
-
Either 'copy' or 'move'.
- $opts : array<string|int, mixed> = array()
-
Additional options:
- create: (boolean) Should the target mailbox be created? DEFAULT: false
Return values
bool —True if successful, false if not.
count()
Index count.
public
count() : int
Return values
int —The number of indices.
current()
public
current() : mixed
delete()
Deletes a list of messages.
public
delete([array<string|int, mixed> $opts = array() ]) : int|bool
Parameters
- $opts : array<string|int, mixed> = array()
-
Additional options:
- keeplog: (boolean) Should any history information of the message be kept? DEFAULT: false - nuke: (boolean) Override user preferences and nuke (i.e. permanently delete) the messages instead? DEFAULT: false
Return values
int|bool —The number of messages deleted if successful, false if not successful.
flag()
Sets or clears a given flag for a list of messages.
public
flag([array<string|int, mixed> $add = array() ][, array<string|int, mixed> $remove = array() ][, array<string|int, mixed> $opts = array() ]) : bool
Parameters
- $add : array<string|int, mixed> = array()
-
A list of IMAP flag(s) to add.
- $remove : array<string|int, mixed> = array()
-
A list of IMAP flag(s) to remove.
- $opts : array<string|int, mixed> = array()
-
Additional options:
- silent: (boolean) Don't output notification messages. DEFAULT: false - unchangedsince: (array) The unchangedsince value to pass to the IMAP store command. Keys are mailbox names, values are the unchangedsince values to use for that mailbox. DEFAULT: array()
Return values
bool —True if successful, false if not.
getSingle()
Returns mailbox/UID information for the first index.
public
getSingle([mixed $all = false ]) : bool
Parameters
- $all : mixed = false
Return values
bool —$all If true, returns all UIDs for the first index in an array. If false, returns the first UID for the first index as a string.
indices()
Return a copy of the indices array.
public
indices() : array<string|int, mixed>
Return values
array<string|int, mixed> —The indices array (keys are mailbox names, values are arrays of UIDs).
key()
public
key() : mixed
mdnCheck()
Check if we need to send a MDN, and send if needed.
public
mdnCheck(Horde_Mime_Headers $headers[, bool $confirmed = false ]) : bool
Parameters
- $headers : Horde_Mime_Headers
-
The headers of the message.
- $confirmed : bool = false
-
Has the MDN request been confirmed?
Return values
bool —True if the MDN request needs to be confirmed.
next()
public
next() : mixed
offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
rewind()
public
rewind() : mixed
stripPart()
Strips one or all MIME parts out of a message.
public
stripPart([string $partid = null ]) : IMP_Indices
Parameters
- $partid : string = null
-
The MIME ID of the part to strip. All parts are stripped if null.
Tags
Return values
IMP_Indices —Returns the new indices object.
toArray()
Returns an array containing compressed UID values.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —Keys are base64 encoded mailbox names, values are sequence strings.
valid()
public
valid() : mixed
_fromSequenceString()
Parse an IMAP message sequence string into a list of indices.
protected
_fromSequenceString(string $str) : array<string|int, mixed>
Extends Horde_Imap_Client_Ids by allowing mailbox information to appear in the string.
Parameters
- $str : string
-
The IMAP message sequence string.
Return values
array<string|int, mixed> —An array of indices. If string contains mailbox info, return value will be an array of arrays, with keys as mailbox names and values as IDs. Otherwise, return the list of IDs.
_toSequenceString()
Create an IMAP message sequence string from a list of indices.
protected
_toSequenceString(array<string|int, mixed> $in) : string
Extends Horde_Imap_Client_Ids by allowing mailbox information to appear in the string.
Parameters
- $in : array<string|int, mixed>
-
An array of indices.
Return values
string —The message sequence string.