PHP Класс IMP_Mailbox, horde

Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_mbox string The IMAP mailbox name (UTF-8).

Открытые методы

Метод Описание
__construct ( $mbox ) Constructor.
__get ( $key )
__set ( $key, $value )
__toString ( )
create ( array $opts = [] ) : boolean Create this mailbox on the server.
createMailboxName ( string $new ) : IMP_Mailbox Return the mailbox name to create given a submailbox name.
delete ( array $opts = [] ) : boolean Deletes mailbox.
emptyMailbox ( ) Empties the entire mailbox.
equals ( mixed $mbox ) : boolean Determines if this mailbox is equal to the given mailbox.
expunge ( array $to_expunge = [], array $opts = [] ) : IMP_Indices Expunges all deleted messages.
filter ( ) Runs filters on this mailbox.
filterOnDisplay ( ) : boolean Filters this mailbox if it is the INBOX and the filter on display pref is active.
flagAll ( array $flags, boolean $action = true ) : boolean Adds or removes flag(s) for all messages in the mailbox.
formFrom ( mixed $mbox ) : mixed Converts a mailbox string from a form representation.
formTo ( mixed $mbox ) : mixed Converts a mailbox string to a form representation.
fromBuids ( IMP_Indices | array $buids ) : IMP_Indices Create an indices object from a list of browser-UIDs.
get ( mixed $mbox ) : mixed Shortcut to obtaining mailbox object(s).
getImapMboxOb ( mixed $mbox ) : mixed Shortcut to obtaining Horde_Imap_Client_Mailbox object(s).
getIndicesOb ( mixed $in ) : IMP_Indices Return an indices object for this mailbox.
getPref ( $pref ) : IMP_Mailbox Shortcut to obtaining a mailbox object from a preference name.
getSearchOb ( ) : IMP_Search_Query Return the search query object for this mailbox.
getSort ( boolean $convert = false ) : IMP_Prefs_Sort_Sortpref Return the sorting preference for this mailbox.
getSpecialMailboxes ( ) : array Return the list of special mailboxes.
getSpecialMailboxesSort ( ) : array Return the list of sorted special mailboxes.
hideDeletedMsgs ( boolean $deleted = false ) : boolean Are deleted messages hidden in this mailbox?
prefFrom ( string $mbox ) : string Converts a mailbox name from a value stored in the preferences.
prefTo ( string $mbox ) : string Converts a mailbox name to a value to be stored in a preference.
rename ( string $new_name ) : boolean Rename this mailbox on the server. The subscription status remains the same. All subfolders will also be renamed.
runSearchQuery ( Horde_Imap_Client_Search_Query $query, integer $sortby = null, integer $sortdir = null ) : IMP_Indices Run a search query on this mailbox that is not stored in the current session. Allows custom queries with custom sorts to be used without affecting cached mailboxes.
setHideDeletedMsgs ( boolean $value ) Sets the 'delhide' preference and clears necessary cached data.
setSort ( integer $by = null, integer $dir = null, boolean $delete = false ) Set the sorting preference for this mailbox.
subscribe ( boolean $sub, array $opts = [] ) : boolean Subscribe/unsubscribe to an IMAP mailbox.
toBuids ( IMP_Indices $uids ) : IMP_Indices Create a BUID indices object from a list of UIDs.
url ( string | Horde_Url $page, string $buid = null, boolean $encode = true ) : Horde_Url Generate a URL using the current mailbox.
urlParams ( string $buid = null ) : array Returns list of URL parameters necessary to indicate current mailbox status.

Защищенные методы

Метод Описание
_getCacheID ( boolean $date = false ) : string Returns a unique identifier for this mailbox's status.
_getDisplay ( boolean $notranslate = false ) : string If there is information available to tell us about a prefix in front of mailbox names that shouldn't be displayed to the user, then use it to strip that prefix out. Additionally, translate prefix text if this is a special mailbox.
_getIcon ( ) : object Return icon information.
_onDelete ( array $deleted ) Do the necessary cleanup/cache updates when deleting mailboxes.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( $mbox )

__get() публичный Метод

public __get ( $key )

__set() публичный Метод

public __set ( $key, $value )

__toString() публичный Метод

public __toString ( )

_getCacheID() защищенный Метод

This cache ID is guaranteed to change if messages are added/deleted from the mailbox. Additionally, if CONDSTORE is available on the remote IMAP server, this ID will change if flag information changes. For search mailboxes, this value never changes (search mailboxes must be forcibly refreshed).
protected _getCacheID ( boolean $date = false ) : string
$date boolean If true, adds date information to ID.
Результат string The cache ID string, which will change when the composition of this mailbox changes.

_getDisplay() защищенный Метод

If there is information available to tell us about a prefix in front of mailbox names that shouldn't be displayed to the user, then use it to strip that prefix out. Additionally, translate prefix text if this is a special mailbox.
protected _getDisplay ( boolean $notranslate = false ) : string
$notranslate boolean Don't translate the mailbox prefix?
Результат string The mailbox, with any prefix gone/translated.

_getIcon() защищенный Метод

Return icon information.
protected _getIcon ( ) : object
Результат object Object with the following properties: - alt - class - icon - iconopen - user_icon

_onDelete() защищенный Метод

Do the necessary cleanup/cache updates when deleting mailboxes.
protected _onDelete ( array $deleted )
$deleted array The list of deleted mailboxes.

create() публичный Метод

Create this mailbox on the server.
public create ( array $opts = [] ) : boolean
$opts array Additional options: - special_use: (array) An array of special-use attributes to attempt to add to the mailbox. DEFAULT: NONE - subscribe: (boolean) Override preference value of subscribe.
Результат boolean True on success.

createMailboxName() публичный Метод

Return the mailbox name to create given a submailbox name.
public createMailboxName ( string $new ) : IMP_Mailbox
$new string The submailbox name (UTF-8).
Результат IMP_Mailbox The mailbox to create.

delete() публичный Метод

Deletes mailbox.
public delete ( array $opts = [] ) : boolean
$opts array Addtional options: - subfolders: (boolean) Delete all subfolders? DEFAULT: false - subfolders_only: (boolean) If deleting subfolders, delete only subfolders (not current mailbox)? DEFAULT: false
Результат boolean True on success.

emptyMailbox() публичный Метод

Empties the entire mailbox.
public emptyMailbox ( )

equals() публичный Метод

Needed because directly comparing two mailbox objects may fail (the member variables may be different).
public equals ( mixed $mbox ) : boolean
$mbox mixed The mailbox to compare to.
Результат boolean True if the mailboxes are the same.

expunge() публичный Метод

Expunges all deleted messages.
public expunge ( array $to_expunge = [], array $opts = [] ) : IMP_Indices
$to_expunge array An optional array of indices to delete. If empty, all messages flagged as deleted in the mailbox will be deleted.
$opts array Additional options:
  - list: (boolean) Return a list of messages expunged.
          DEFAULT: false
Результат IMP_Indices If 'list' option is true, an indices object containing the messages that have been expunged.

filter() публичный Метод

Runs filters on this mailbox.
public filter ( )

filterOnDisplay() публичный Метод

Filters this mailbox if it is the INBOX and the filter on display pref is active.
public filterOnDisplay ( ) : boolean
Результат boolean True if filter() was called.

flagAll() публичный Метод

This function works with IMAP only, not POP3.
public flagAll ( array $flags, boolean $action = true ) : boolean
$flags array The IMAP flag(s) to add or remove.
$action boolean If true, add the flag(s); otherwise, remove the flag(s).
Результат boolean True if successful, false if not.

formFrom() публичный статический Метод

Needed because null characters (used for various internal non-IMAP mailbox representations) will not work in form elements.
public static formFrom ( mixed $mbox ) : mixed
$mbox mixed The mailbox name(s).
Результат mixed The mailbox object(s).

formTo() публичный статический Метод

Needed because null characters (used for various internal non-IMAP mailbox representations) will not work in form elements.
public static formTo ( mixed $mbox ) : mixed
$mbox mixed The mailbox name(s).
Результат mixed The converted mailbox string(s).

fromBuids() публичный Метод

Create an indices object from a list of browser-UIDs.
public fromBuids ( IMP_Indices | array $buids ) : IMP_Indices
$buids IMP_Indices | array Browser-UIDs.
Результат IMP_Indices An indices object.

get() публичный статический Метод

Shortcut to obtaining mailbox object(s).
public static get ( mixed $mbox ) : mixed
$mbox mixed The full IMAP mailbox name(s).
Результат mixed The IMP_Mailbox object(s).

getImapMboxOb() публичный статический Метод

Shortcut to obtaining Horde_Imap_Client_Mailbox object(s).
public static getImapMboxOb ( mixed $mbox ) : mixed
$mbox mixed The full IMAP mailbox name(s).
Результат mixed The Horde_Imap_Client_Mailbox object(s).

getIndicesOb() публичный Метод

Return an indices object for this mailbox.
public getIndicesOb ( mixed $in ) : IMP_Indices
$in mixed Either a single UID, array of UIDs, or a Horde_Imap_Client_Ids object.
Результат IMP_Indices An indices object.

getPref() публичный статический Метод

Shortcut to obtaining a mailbox object from a preference name.
public static getPref ( $pref ) : IMP_Mailbox
Результат IMP_Mailbox The IMP_Mailbox object.

getSearchOb() публичный Метод

Return the search query object for this mailbox.
public getSearchOb ( ) : IMP_Search_Query
Результат IMP_Search_Query The search query object.

getSort() публичный Метод

Return the sorting preference for this mailbox.
public getSort ( boolean $convert = false ) : IMP_Prefs_Sort_Sortpref
$convert boolean Convert 'by' to a Horde_Imap_Client constant?
Результат IMP_Prefs_Sort_Sortpref Sortpref object.

getSpecialMailboxes() публичный статический Метод

Return the list of special mailboxes.
public static getSpecialMailboxes ( ) : array
Результат array A list of mailboxes, with the self::SPECIAL_* constants as keys and values containing the IMP_Mailbox objects or null if the mailbox doesn't exist (self::SPECIAL_SENT contains an array of objects).

getSpecialMailboxesSort() публичный статический Метод

Return the list of sorted special mailboxes.
public static getSpecialMailboxesSort ( ) : array
Результат array The list of sorted special mailboxes (IMP_Mailbox objects).

hideDeletedMsgs() публичный Метод

Are deleted messages hidden in this mailbox?
public hideDeletedMsgs ( boolean $deleted = false ) : boolean
$deleted boolean Return value is what should be done with deleted messages in general, as opposed to any deleted message in the mailbox.
Результат boolean True if deleted messages should be hidden.

prefFrom() публичный статический Метод

Converts a mailbox name from a value stored in the preferences.
public static prefFrom ( string $mbox ) : string
$mbox string The mailbox name as stored in a preference.
Результат string The full IMAP mailbox name (UTF-8).

prefTo() публичный статический Метод

Converts a mailbox name to a value to be stored in a preference.
public static prefTo ( string $mbox ) : string
$mbox string The full IMAP mailbox name (UTF-8).
Результат string The value to store in a preference.

rename() публичный Метод

Rename this mailbox on the server. The subscription status remains the same. All subfolders will also be renamed.
public rename ( string $new_name ) : boolean
$new_name string The new mailbox name (UTF-8).
Результат boolean True on success

runSearchQuery() публичный Метод

Run a search query on this mailbox that is not stored in the current session. Allows custom queries with custom sorts to be used without affecting cached mailboxes.
public runSearchQuery ( Horde_Imap_Client_Search_Query $query, integer $sortby = null, integer $sortdir = null ) : IMP_Indices
$query Horde_Imap_Client_Search_Query The search query object.
$sortby integer The sort criteria.
$sortdir integer The sort directory.
Результат IMP_Indices An indices object.

setHideDeletedMsgs() публичный Метод

Sets the 'delhide' preference and clears necessary cached data.
public setHideDeletedMsgs ( boolean $value )
$value boolean The value to set 'delhide' to.

setSort() публичный Метод

Set the sorting preference for this mailbox.
public setSort ( integer $by = null, integer $dir = null, boolean $delete = false )
$by integer The sort type.
$dir integer The sort direction.
$delete boolean Delete the entry?

subscribe() публичный Метод

Subscribe/unsubscribe to an IMAP mailbox.
public subscribe ( boolean $sub, array $opts = [] ) : boolean
$sub boolean True to subscribe, false to unsubscribe.
$opts array Additional options: - subfolders: (boolean) If true, applies actions to all subfolders.
Результат boolean True on success.

toBuids() публичный Метод

Create a BUID indices object from a list of UIDs.
public toBuids ( IMP_Indices $uids ) : IMP_Indices
$uids IMP_Indices UIDs.
Результат IMP_Indices An indices object.

url() публичный Метод

Generate a URL using the current mailbox.
public url ( string | Horde_Url $page, string $buid = null, boolean $encode = true ) : Horde_Url
$page string | Horde_Url Page name to link to.
$buid string The BUID to use on the linked page.
$encode boolean Encode the argument separator?
Результат Horde_Url URL to $page with any necessary mailbox information added to the parameter list of the URL.

urlParams() публичный Метод

Returns list of URL parameters necessary to indicate current mailbox status.
public urlParams ( string $buid = null ) : array
$buid string The BUID to use on the linked page.
Результат array The list of parameters needed to indicate the current mailbox status.

Описание свойств

$_mbox защищенное свойство

The IMAP mailbox name (UTF-8).
protected string $_mbox
Результат string