Class IMP_Mailbox

Description

The IMP_Mailbox:: class contains all code related to handling mailbox access.

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Mailbox.php (line 25)


	
			
Variable Summary
 integer $_arrayIndex
 boolean $_build
 boolean $_cacheexpire
 string $_mailbox
 boolean $_searchmbox
 array $_sorted
 array $_sortedInfo
Method Summary
 IMP_Mailbox IMP_Mailbox (string $mailbox, [integer $index = null])
 stdClass buildMailboxPage ([integer $page = 0], [integer $start = 0], [integer $page_size = null])
 integer getArrayIndex (integer $uid, [integer $mbox = null])
 string getCacheID ()
 array getIMAPIndex ([integer $offset = 0])
 array getMailboxArray (array $msgnum, [mixed $preview = false], [boolean $header = false])
 string getMailboxName ()
 integer getMessageCount ()
 integer getMessageIndex ()
 array getSortedList ()
 boolean isValidIndex ()
 integer newMessages ([boolean $count = false])
 void setIndex (integer $data, [string $type = 'uid'])
 mixed &singleton (string $mailbox, [integer $index = null])
 array unseenMessages ([boolean $count = false])
 void updateMailbox (integer $action, [array $indices = null])
Variables
integer $_arrayIndex = null (line 39)

The location in the sorted array we are at.

boolean $_build = false (line 53)

Has _buildMailbox() been called?

boolean $_cacheexpire = false (line 77)

If the cache has expired, make note so we know when to update vs.

overwrite.

integer $_lastArrayIndex = null (line 46)

The location of the last message we were at.

string $_mailbox (line 32)

The mailbox to work with.

boolean $_searchmbox (line 84)

Is this a search malbox?

array $_sorted = array() (line 60)

The array of sorted indices.

array $_sortedInfo = array() (line 69)

The array of information about the sorted indices list.

Entries: 'm' = Mailbox (if not exist, then use current mailbox)

Methods
Constructor IMP_Mailbox (line 121)

Constructor.

IMP_Mailbox IMP_Mailbox (string $mailbox, [integer $index = null])
  • string $mailbox: The mailbox to work with.
  • integer $index: The index of the current message. This will cause IMP_Message to update the various message arrays after each action.
buildMailboxPage (line 505)

Using the preferences and the current mailbox, determines the messages to view on the current page.

  • return: An object with the following fields:
     'anymsg'     -  Are there any messages at all in mailbox? E.g. If
                     'msgcount' is 0, there may still be hidden deleted
                     messages.
     'begin'      -  The beginning message number of the page.
     'end'        -  The ending message number of the page.
     'index'      -  The index of the starting message.
     'msgcount'   -  The number of viewable messages in the current mailbox.
     'page'       -  The current page number.
     'pagecount'  -  The number of pages in this mailbox.
stdClass buildMailboxPage ([integer $page = 0], [integer $start = 0], [integer $page_size = null])
  • integer $page: The page number currently being displayed.
  • integer $start: The starting message number.
  • integer $page_size: Override the maxmsgs preference and specify the page size.
getArrayIndex (line 790)

Returns the array index of the given message UID.

  • return: The array index of the location of the message UID in the current mailbox.
integer getArrayIndex (integer $uid, [integer $mbox = null])
  • integer $uid: The message UID.
  • integer $mbox: The message mailbox (defaults to the current mailbox).
getCacheID (line 848)

Returns a unique identifier for the current mailbox status.

  • return: The cache ID string, which will change when the status of the mailbox changes.
  • since: IMP 4.2
string getCacheID ()
getIMAPIndex (line 411)

Returns IMAP mbox/UID information on a message.

  • return: 'index' -- The message index. 'mailbox' -- The mailbox.
array getIMAPIndex ([integer $offset = 0])
  • integer $offset: The offset from the current message.
getMailboxArray (line 163)

Build the array of message information.

  • return: An array with information on the requested messages.
     Key: array index in current sorted mailbox array
     Value: stdClass object - see IMP_MessageCache::retrieve() for fields
  • since: IMP 4.2
array getMailboxArray (array $msgnum, [mixed $preview = false], [boolean $header = false])
  • array $msgnum: An array of message numbers.
  • mixed $preview: Include preview information? If empty, add no preview information. If 1, uses value from prefs. If 2, forces addition of preview info.
  • boolean $header: Return IMP_Header information?
getMailboxName (line 141)

The mailbox this object works with.

  • return: A mailbox name.
string getMailboxName ()
getMessageCount (line 383)

Returns the current message count of the mailbox.

  • return: The mailbox message count.
integer getMessageCount ()
getMessageIndex (line 367)

Returns the current message array index. If the array index has run off the end of the message array, will return the last index.

  • return: The message array index.
integer getMessageIndex ()
getSortedList (line 826)

Returns a raw sorted list of the mailbox.

  • return: An array with two keys: 's' = sorted UIDS list, 'm' = sorted mailboxes list.
  • since: IMP 4.2
array getSortedList ()
getThreadOb (line 680)

Get the IMP_Thread object for the current mailbox.

  • return: The IMP_Thread object for the current mailbox.
IMP_Thread getThreadOb ()
isValidIndex (line 397)

Checks to see if the current index is valid.

This function is only useful if an index was passed to the constructor.

  • return: True if index is valid, false if not.
boolean isValidIndex ()
newMessages (line 307)

Get the list of new messages in the mailbox (IMAP RECENT flag, with UNDELETED if we're hiding deleted messages).

  • return: The number of new messages in the mailbox.
integer newMessages ([boolean $count = false])
  • boolean $count: Return a count of new messages, rather than the entire message list?
setIndex (line 659)

Updates the message array index.

void setIndex (integer $data, [string $type = 'uid'])
  • integer $data: If $type is 'offset', the number of messages to increase array index by. If type is 'uid', sets array index to the value of the given message index.
  • string $type: Either 'offset' or 'uid'.
singleton (line 100)

Attempts to return a reference to a concrete IMP_Mailbox instance.

It will only create a new instance if no IMP_Mailbox instance with the same parameters currently exists.

This method must be invoked as: $var = &IMP_Mailbox::singleton($mailbox[, $index]);

  • return: The created concrete IMP_Mailbox instance, or false on error.
mixed &singleton (string $mailbox, [integer $index = null])
  • string $mailbox: See IMP_Mailbox constructor.
  • integer $index: See IMP_Mailbox constructor.
unseenMessages (line 321)

Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with UNDELETED if we're hiding deleted messages).

  • return: The list of unseen messages.
array unseenMessages ([boolean $count = false])
  • boolean $count: Return a count of unseen messages, rather than the entire message list?
updateMailbox (line 434)

Update the current mailbox if an action has been performed on the current message index.

void updateMailbox (integer $action, [array $indices = null])
  • integer $action: The action to perform.
  • array $indices: The list of indices to update. See IMP::parseIndicesList() for format.

Documentation generated on Sun, 30 Jan 2011 05:28:14 +0000 by phpDocumentor 1.4.3