PHP Class IMP_Indices, horde

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

Protected Properties

Property Type Description
$_indices array The indices list.

Public Methods

Method Description
__construct ( ) Constructor.
__toString ( ) : string String representation of the object.
add ( ) Add indices.
copy ( string $targetMbox, string $action, array $opts = [] ) : boolean Copies or moves a list of messages to a new mailbox.
count ( ) : integer Index count.
current ( ) * Iterator methods.
delete ( array $opts = [] ) : integer | boolean Deletes a list of messages.
flag ( array $add = [], array $remove = [], array $opts = [] ) : boolean Sets or clears a given flag for a list of messages.
getSingle ( $all = false ) : array Returns mailbox/UID information for the first index.
indices ( ) : array Return a copy of the indices array.
key ( )
mdnCheck ( Horde_Mime_Headers $headers, boolean $confirmed = false ) : boolean Check if we need to send a MDN, and send if needed.
next ( )
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
rewind ( )
stripPart ( string $partid = null ) : IMP_Indices Strips one or all MIME parts out of a message.
toArray ( ) : array Returns an array containing compressed UID values.
valid ( )

Protected Methods

Method Description
_fromSequenceString ( string $str ) : array Parse an IMAP message sequence string into a list of indices.
_toSequenceString ( array $in ) : string Create an IMAP message sequence string from a list of indices.

Method Details

__construct() public method

Parameters are the same as add().
See also: add()
public __construct ( )

__toString() public method

String representation of the object.
public __toString ( ) : string
return string String representation (IMAP sequence string).

_fromSequenceString() protected method

Extends Horde_Imap_Client_Ids by allowing mailbox information to appear in the string.
protected _fromSequenceString ( string $str ) : array
$str string The IMAP message sequence string.
return array 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() protected method

Extends Horde_Imap_Client_Ids by allowing mailbox information to appear in the string.
protected _toSequenceString ( array $in ) : string
$in array An array of indices.
return string The message sequence string.

add() public method

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.
public add ( )

copy() public method

Also handles moves to the tasklist and/or notepad applications.
public copy ( string $targetMbox, string $action, array $opts = [] ) : boolean
$targetMbox string The mailbox to move/copy messages to (UTF-8).
$action string Either 'copy' or 'move'.
$opts array Additional options:
  - create: (boolean) Should the target mailbox be created?
            DEFAULT: false
return boolean True if successful, false if not.

count() public method

Index count.
public count ( ) : integer
return integer The number of indices.

current() public method

* Iterator methods.
public current ( )

delete() public method

Deletes a list of messages.
public delete ( array $opts = [] ) : integer | boolean
$opts 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 integer | boolean The number of messages deleted if successful, false if not successful.

flag() public method

Sets or clears a given flag for a list of messages.
public flag ( array $add = [], array $remove = [], array $opts = [] ) : boolean
$add array A list of IMAP flag(s) to add.
$remove array A list of IMAP flag(s) to remove.
$opts 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 boolean True if successful, false if not.

getSingle() public method

Returns mailbox/UID information for the first index.
public getSingle ( $all = false ) : array
return array $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() public method

Return a copy of the indices array.
public indices ( ) : array
return array The indices array (keys are mailbox names, values are arrays of UIDs).

key() public method

public key ( )

mdnCheck() public method

Check if we need to send a MDN, and send if needed.
public mdnCheck ( Horde_Mime_Headers $headers, boolean $confirmed = false ) : boolean
$headers Horde_Mime_Headers The headers of the message.
$confirmed boolean Has the MDN request been confirmed?
return boolean True if the MDN request needs to be confirmed.

next() public method

public next ( )

offsetExists() public method

public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

rewind() public method

public rewind ( )

stripPart() public method

Strips one or all MIME parts out of a message.
public stripPart ( string $partid = null ) : IMP_Indices
$partid string The MIME ID of the part to strip. All parts are stripped if null.
return IMP_Indices Returns the new indices object.

toArray() public method

Returns an array containing compressed UID values.
public toArray ( ) : array
return array Keys are base64 encoded mailbox names, values are sequence strings.

valid() public method

public valid ( )

Property Details

$_indices protected_oe property

The indices list.
protected array $_indices
return array