Name

Store Functions — This section describes functions which are performed on MAPI Store objects.

Synopsis

mapifolder mapi_msgstore_getreceivefolder(mapimsgstore $store);
resource mapi_msgstore_openentry(mapimsgstore $messagestore,
                                 string $entryID,
                                 long $flags);

string mapi_msgstore_createentryid(resource $store,
                                   string $username);

mapitable mapi_msgstore_openmultistoretable(mapimsgstore $store,
                                            array $entryids,
                                            long $flags);

Details

mapi_msgstore_getreceivefolder ()

mapifolder mapi_msgstore_getreceivefolder(mapimsgstore $store)

Open the inbox for the specified store.

This function requests the EntryID for the inbox of the given store and opens the folder. Returns a mapifolder object on success, FALSE on failure.

$store
The store of which the inbox is required.

Example 3.24. Opening the inbox of a store

// Open the inbox for a user
$store = mapi_logon_zarafa($username, $password, $serverlocation);
$stores = mapi_getmsgstorestable($session);
$storeslist = mapi_table_queryallrows($stores);
$userstore = mapi_openmsgstore($session, $storeslist[0][PR_ENTRYID]);
$inbox = mapi_msgstore_getreceivefolder($userstore);
		

mapi_msgstore_openentry ()

resource mapi_msgstore_openentry(mapimsgstore $messagestore, string $entryID, long $flags

Opens an entry from the messagestore.

This function opens an entry from the messagestore. The function will return a mapifolder or a mapimessage, depending on the entryID. Returns a mapimessage or mapifolder object on success, FALSE on failure.

$messagestore
The current messagestore used.
$flags (optional)

Bitmask of flags that controls how information is returned in the table. The following flags can be set:

MAPI_BEST_ACCESS

Requests that the object be opened with the maximum network permissions allowed for the user and the maximum client application access. For example, if the client has read/write access, the object should be opened with read/write access; if the client has read-only access, the object should be opened with read-only access.

MAPI_MODIFY

Requests read/write access. By default, objects are opened with read-only access, and clients should not work on the assumption that read/write access has been granted.

SHOW_SOFT_DELETES

Open a Soft Deleted Message or Folder.

Example 3.25. Opening an entry from a messagestore

// Open a folder from a store
$folder = mapi_msgstore_openentry($store, $folder_entryid);

// Open a message from a store
$message = mapi_msgstore_openentry($store, $message_entryid);
		

mapi_msgstore_createentryid ()

string mapi_msgstore_createentryid(resource $store, string $username)

Returns an entryid string to an arbitrary user store which exists on the Zarafa server.

Creates an EntryID to use with mapi_openmsgstore() function. Result is false if the store was not found, otherwise it will return a valid entryid.

$store
The store of the currently logged in user, which was opened with mapi_openmsgstore().
$username
The username of the store that needs to be opened.

Example 3.26. Opening a Zarafa message store

$user2_entryid = mapi_msgstore_createentryid($userstore, "user2");
$user2_store = mapi_openmsgstore($session, $user2_entryid);
		

mapi_msgstore_openmultistoretable ()

mapitable mapi_msgstore_openmultistoretable(mapimsgstore $store, array $entryids, long $flags

Open a special table that may contain items from different stores. The items you wish the table to contain is passed to this function.

This function opens a special table which contains items the user sets. The return value can be treated a normal table, using the mapi_table_* functions to handle it.. Returns a mapitable object on success, FALSE on failure.

$store
The store of which the inbox is required.
$entryids
An array of message entry id's. This array may contain entry id's from any store.
$flags (optional)
Flags which is currently unsused, and is 0 by default. You do not need to pass this parameter.

Example 3.27. Opening the special multistore table

// Open the inbox for a user
$store = mapi_logon_zarafa($username, $password, $serverlocation);
$stores = mapi_getmsgstorestable($session);
$storeslist = mapi_table_queryallrows($stores);
$userstore = mapi_openmsgstore($session, $storeslist[0][PR_ENTRYID]);
// array() should be replaced with an array of entry id's of messages
$mst = mapi_msgstore_openmultistoretable($userstore, array());