Properties

$_type

$_type : string

The folder type.

Type

string

$_version

$_version : integer

The version of the data.

Type

integer

$_queries

$_queries : array

The list of registered queries.

Type

array

$_logger

$_logger : \Horde_Log_Logger

Logger instance, or stub.

Type

\Horde_Log_Logger — | Horde_Support_Stub

$_init

$_init : boolean

Has the cache already been loaded and validated?

Type

boolean

Methods

__construct()

__construct(\Horde_Kolab_Storage_Folder  $folder, \Horde_Kolab_Storage_Driver  $driver, \Horde_Kolab_Storage_Factory  $factory, \Horde_Kolab_Storage_Cache  $cache, string  $type = null, integer  $version = 1) 

Constructor.

Parameters

\Horde_Kolab_Storage_Folder $folder

The folder to retrieve the data from.

\Horde_Kolab_Storage_Driver $driver

The primary connection driver.

\Horde_Kolab_Storage_Factory $factory

The factory.

\Horde_Kolab_Storage_Cache $cache

The cache storing data for this decorator.

string $type

The type of data we want to access in the folder.

integer $version

Format version of the object data.

setLogger()

setLogger(\Horde_Log_Logger  $logger) 

Set a logger.

Parameters

\Horde_Log_Logger $logger

The logger instance.

getPath()

getPath() : string

Return the folder path for this data handler.

Returns

string —

The folder path.

getAuth()

getAuth() : string

Return the ID of the current user.

Returns

string —

The current user.

getId()

getId() : string

Return the ID of this data handler.

Returns

string —

The ID.

getIdParameters()

getIdParameters() : array

Return the ID parameters for this data handler.

Returns

array —

The ID parameters.

getType()

getType() : string

Return the data type represented by this object.

Returns

string —

The type of data this instance handles.

getVersion()

getVersion() : string

Return the data version.

Returns

string —

The data version.

getStamp()

getStamp(\Horde_Kolab_Storage_Folder_Stamp  $previous = null) : \Horde_Kolab_Storage_Folder_Stamp

Report the status of this folder.

Parameters

\Horde_Kolab_Storage_Folder_Stamp $previous

The previous stamp, if available.

Returns

\Horde_Kolab_Storage_Folder_Stamp

The stamp that can be used for detecting folder changes.

create()

create(  $object, boolean  $raw = false) : string

Create a new object.

Parameters

$object
boolean $raw

True if the data to be stored has been provided in raw format.

Throws

\Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Returns

string —

The ID of the new object or true in case the backend does not support this return value.

modify()

modify(array  $object, boolean  $raw = false) : string

Modify an existing object.

Parameters

array $object

The array that holds the updated object data.

boolean $raw

True if the data to be stored has been provided in raw format.

Throws

\Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Returns

string —

The new backend ID of the modified object or true in case the backend does not support this return value.

fetchComplete()

fetchComplete(string  $uid) : array

Retrieves the complete message for the given UID.

Parameters

string $uid

The message UID.

Returns

array —

The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchPart()

fetchPart(string  $uid, string  $id) : resource

Retrieves the body part for the given UID and mime part ID.

Parameters

string $uid

The message UID.

string $id

The mime part ID.

Returns

resource —

The message part as stream resource.

fetch()

fetch(array  $uids, boolean  $raw = false) : array

Retrieves the objects for the given UIDs.

Parameters

array $uids

The message UIDs.

boolean $raw

True if the raw format should be returned rather than the parsed data.

Throws

\new

Horde_Kolab_Storage_Exception

Returns

array —

An array of objects.

getBackendId()

getBackendId(  $object_id) : string

Return the backend ID for the given object ID.

Parameters

$object_id

Returns

string —

The backend ID for the object.

objectIdExists()

objectIdExists(string  $object_id) : boolean

Check if the given object ID exists.

Parameters

string $object_id

The object ID.

Returns

boolean —

True if the ID was found, false otherwise.

getObject()

getObject(string  $object_id) : array

Return the specified object.

Parameters

string $object_id

The object id.

Returns

array —

The object data as an array.

getAttachment()

getAttachment(string  $object_id, string  $attachment_id) : resource

Returns the specified attachment.

Parameters

string $object_id

The object id. @since Kolab_Storage 2.1.0

string $attachment_id

The attachment id.

Returns

resource —

An open stream to the attachment data.

getObjectIds()

getObjectIds() : array

Retrieve all object ids in the current folder.

Returns

array —

The object ids.

getObjects()

getObjects() : array

Retrieve all objects in the current folder.

Returns

array —

An array of all objects.

getObjectsByBackendId()

getObjectsByBackendId() : array

Retrieve all objects in the current folder by backend id.

Returns

array —

An array of all objects.

getObjectByBackendId()

getObjectByBackendId(string  $uid) : array

Retrieve an object in the current folder by backend id.

Parameters

string $uid

Backend id of the object to be returned.

Returns

array —

An array of all objects.

getObjectToBackend()

getObjectToBackend() : array

Return the mapping of object IDs to backend IDs.

Returns

array —

The object to backend mapping.

getDuplicates()

getDuplicates() : array

Retrieve the list of object duplicates.

Returns

array —

The list of duplicates.

getErrors()

getErrors() : array

Retrieve the list of object errors.

Returns

array —

The list of errors.

move()

move(string  $object_id, string  $new_folder) : NULL

Move the specified message from the current folder into a new folder.

Parameters

string $object_id

ID of the message to be moved.

string $new_folder

Target folder.

Returns

NULL

delete()

delete(array|string  $object_ids) : NULL

Delete the specified objects from this data set.

Parameters

array|string $object_ids

Id(s) of the object to be deleted.

Returns

NULL

deleteAll()

deleteAll() : NULL

Delete all objects from this data set.

Returns

NULL

deleteBackendIds()

deleteBackendIds(array|string  $uids) : NULL

Delete the specified messages from this folder.

Parameters

array|string $uids

Backend id(s) of the message to be deleted.

Returns

NULL

registerQuery()

registerQuery(string  $name, \Horde_Kolab_Storage_Query  $query) 

Register a query to be updated if the underlying data changes.

Parameters

string $name

The query name.

\Horde_Kolab_Storage_Query $query

The query to register.

Throws

\new

Horde_Kolab_Storage_Exception

synchronize()

synchronize(array  $params = array()) : NULL

Synchronize the query data with the information from the backend.

Parameters

array $params

Additional parameters.

Returns

NULL

getQuery()

getQuery(string  $name = null) : \Horde_Kolab_Storage_Query

Return a registered query.

Parameters

string $name

The query name.

Throws

\Horde_Kolab_Storage_Exception

In case the requested query does not exist.

Returns

\Horde_Kolab_Storage_Query

The requested query.

generateUid()

generateUid() : string

Generate a unique object ID.

Returns

string —

The unique ID.

_isInitialized()

_isInitialized() : NULL

Check if the cache has been initialized.

Returns

NULL

_init()

_init() 

Check if the cache has been initialized at all and synchronize it if not.

_completeSynchronization()

_completeSynchronization(\Horde_Kolab_Storage_Folder_Stamp  $stamp, array  $params = array()) : NULL

Perform a complete synchronization.

Parameters

\Horde_Kolab_Storage_Folder_Stamp $stamp

The current stamp.

array $params

Additional parameters.

Returns

NULL