Documentation

Horde_Kolab_Storage_Data_Cached extends Horde_Kolab_Storage_Data_Base
in package

The cache decorator for Kolab storage data handlers.

Copyright 2011-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Kolab

author

Gunnar Wrobel wrobel@pardus.de

author

Thomas Jarosch thomas.jarosch@intra2net.com

author

Michael J Rubinsky mrubinsk@horde.org

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_data_cache  : Horde_Kolab_Storage_Cache_Data
The data cache.
$_driver  : Horde_Kolab_Storage_Driver
The driver for accessing the Kolab storage system.
$_factory  : Horde_Kolab_Storage_Factory
The factory for generating additional resources.
$_folder  : Horde_Kolab_Storage_Folder
The link to the parent folder object.
$_init  : bool
Has the cache already been loaded and validated?
$_logger  : Horde_Log_Logger
Logger instance, or stub.
$_queries  : array<string|int, mixed>
The list of registered queries.
$_type  : string
The folder type.
$_version  : int
The version of the data.
__construct()  : mixed
Constructor.
create()  : string
Create a new object.
delete()  : null
Delete the specified objects from this data set.
deleteAll()  : null
Delete all objects from this data set.
deleteBackendIds()  : null
Delete the specified messages from this folder.
fetch()  : array<string|int, mixed>
Retrieves the objects for the given UIDs.
fetchComplete()  : array<string|int, mixed>
Retrieves the complete message for the given UID.
fetchPart()  : resource
Retrieves the body part for the given UID and mime part ID.
generateUid()  : string
Generate a unique object ID.
getAttachment()  : resource
Returns the specified attachment.
getAuth()  : string
Return the ID of the current user.
getBackendId()  : string
Return the backend ID for the given object ID.
getDuplicates()  : array<string|int, mixed>
Retrieve the list of object duplicates.
getErrors()  : array<string|int, mixed>
Retrieve the list of object errors.
getId()  : string
Return the ID of this data handler.
getIdParameters()  : array<string|int, mixed>
Return the ID parameters for this data handler.
getObject()  : array<string|int, mixed>
Return the specified object.
getObjectByBackendId()  : array<string|int, mixed>
Retrieve an object in the current folder by backend id.
getObjectIds()  : array<string|int, mixed>
Retrieve all object ids in the current folder.
getObjects()  : array<string|int, mixed>
Retrieve all objects in the current folder.
getObjectsByBackendId()  : array<string|int, mixed>
Retrieve all objects in the current folder by backend id.
getObjectToBackend()  : array<string|int, mixed>
Return the mapping of object IDs to backend IDs.
getPath()  : string
Return the folder path for this data handler.
getQuery()  : Horde_Kolab_Storage_Query
Return a registered query.
getStamp()  : Horde_Kolab_Storage_Folder_Stamp
Report the status of this folder.
getType()  : string
Return the data type represented by this object.
getVersion()  : string
Return the data version.
modify()  : string
Modify an existing object.
move()  : null
Move the specified message from the current folder into a new folder.
objectIdExists()  : bool
Check if the given object ID exists.
registerQuery()  : mixed
Register a query to be updated if the underlying data changes.
setLogger()  : mixed
Set a logger.
synchronize()  : null
Synchronize the query data with the information from the backend.
_init()  : mixed
Check if the cache has been initialized at all and synchronize it if not.
_isInitialized()  : null
Check if the cache has been initialized.
_completeSynchronization()  : null
Perform a complete synchronization.

Properties

$_init

Has the cache already been loaded and validated?

protected bool $_init = \false

$_logger

Logger instance, or stub.

protected Horde_Log_Logger $_logger

| Horde_Support_Stub

$_queries

The list of registered queries.

protected array<string|int, mixed> $_queries = array()

$_type

The folder type.

protected string $_type

$_version

The version of the data.

protected int $_version

Methods

__construct()

Constructor.

public __construct(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Factory $factory, Horde_Kolab_Storage_Cache $cache[, string $type = null ][, int $version = 1 ]) : mixed
Parameters
$folder : Horde_Kolab_Storage_Folder

The folder to retrieve the data from.

$driver : Horde_Kolab_Storage_Driver

The primary connection driver.

$factory : Horde_Kolab_Storage_Factory

The factory.

$cache : Horde_Kolab_Storage_Cache

The cache storing data for this decorator.

$type : string = null

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

$version : int = 1

Format version of the object data.

Return values
mixed —

create()

Create a new object.

public create(array<string|int, mixed> &$object[, bool $raw = false ]) : string
Parameters
$object : array<string|int, mixed>

The array that holds the object data.

$raw : bool = false

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

Tags
throws
Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Return values
string —

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

delete()

Delete the specified objects from this data set.

public delete(array<string|int, mixed>|string $object_ids) : null
Parameters
$object_ids : array<string|int, mixed>|string

Id(s) of the object to be deleted.

Return values
null —

deleteAll()

Delete all objects from this data set.

public deleteAll() : null
Return values
null —

deleteBackendIds()

Delete the specified messages from this folder.

public deleteBackendIds(array<string|int, mixed>|string $uids) : null
Parameters
$uids : array<string|int, mixed>|string

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

Return values
null —

fetch()

Retrieves the objects for the given UIDs.

public fetch(array<string|int, mixed> $uids[, bool $raw = false ]) : array<string|int, mixed>
Parameters
$uids : array<string|int, mixed>

The message UIDs.

$raw : bool = false

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

Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
array<string|int, mixed> —

An array of objects.

fetchComplete()

Retrieves the complete message for the given UID.

public fetchComplete(string $uid) : array<string|int, mixed>
Parameters
$uid : string

The message UID.

Return values
array<string|int, mixed> —

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

fetchPart()

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

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

The message UID.

$id : string

The mime part ID.

Return values
resource —

The message part as stream resource.

generateUid()

Generate a unique object ID.

public generateUid() : string
Return values
string —

The unique ID.

getAttachment()

Returns the specified attachment.

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

The object id. @since Kolab_Storage 2.1.0

$attachment_id : string

The attachment id.

Return values
resource —

An open stream to the attachment data.

getAuth()

Return the ID of the current user.

public getAuth() : string
Return values
string —

The current user.

getBackendId()

Return the backend ID for the given object ID.

public getBackendId(mixed $object_id) : string
Parameters
$object_id : mixed
Return values
string —

The backend ID for the object.

getDuplicates()

Retrieve the list of object duplicates.

public getDuplicates() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The list of duplicates.

getErrors()

Retrieve the list of object errors.

public getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The list of errors.

getId()

Return the ID of this data handler.

public getId() : string
Return values
string —

The ID.

getIdParameters()

Return the ID parameters for this data handler.

public getIdParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The ID parameters.

getObject()

Return the specified object.

public getObject(string $object_id) : array<string|int, mixed>
Parameters
$object_id : string

The object id.

Return values
array<string|int, mixed> —

The object data as an array.

getObjectByBackendId()

Retrieve an object in the current folder by backend id.

public getObjectByBackendId(string $uid) : array<string|int, mixed>
Parameters
$uid : string

Backend id of the object to be returned.

Return values
array<string|int, mixed> —

An array of all objects.

getObjectIds()

Retrieve all object ids in the current folder.

public getObjectIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The object ids.

getObjects()

Retrieve all objects in the current folder.

public getObjects() : array<string|int, mixed>
Return values
array<string|int, mixed> —

An array of all objects.

getObjectsByBackendId()

Retrieve all objects in the current folder by backend id.

public getObjectsByBackendId() : array<string|int, mixed>
Return values
array<string|int, mixed> —

An array of all objects.

getObjectToBackend()

Return the mapping of object IDs to backend IDs.

public getObjectToBackend() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The object to backend mapping.

getPath()

Return the folder path for this data handler.

public getPath() : string
Return values
string —

The folder path.

getType()

Return the data type represented by this object.

public getType() : string
Return values
string —

The type of data this instance handles.

getVersion()

Return the data version.

public getVersion() : string
Return values
string —

The data version.

modify()

Modify an existing object.

public modify(array<string|int, mixed> $object[, bool $raw = false ]) : string
Parameters
$object : array<string|int, mixed>

The array that holds the updated object data.

$raw : bool = false

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

Tags
throws
Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Return values
string —

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

move()

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

public move(string $object_id, string $new_folder) : null
Parameters
$object_id : string

ID of the message to be moved.

$new_folder : string

Target folder.

Return values
null —

objectIdExists()

Check if the given object ID exists.

public objectIdExists(string $object_id) : bool
Parameters
$object_id : string

The object ID.

Return values
bool —

True if the ID was found, false otherwise.

registerQuery()

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

public registerQuery(string $name, Horde_Kolab_Storage_Query $query) : mixed
Parameters
$name : string

The query name.

$query : Horde_Kolab_Storage_Query

The query to register.

Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
mixed —

setLogger()

Set a logger.

public setLogger(Horde_Log_Logger $logger) : mixed
Parameters
$logger : Horde_Log_Logger

The logger instance.

Return values
mixed —

synchronize()

Synchronize the query data with the information from the backend.

public synchronize([mixed $params = array() ]) : null
Parameters
$params : mixed = array()

Additional parameters.

Tags
see
Horde_Kolab_Storage_Query

In addition to the parameters of the base class(es), the following may be passed as well:

  • logger: (Horde_Log_Logger) A logger instance.
Return values
null —

_init()

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

protected _init() : mixed
Return values
mixed —

_isInitialized()

Check if the cache has been initialized.

protected _isInitialized() : null
Return values
null —

_completeSynchronization()

Perform a complete synchronization.

private _completeSynchronization(Horde_Kolab_Storage_Folder_Stamp $stamp[, array<string|int, mixed> $params = array() ]) : null
Parameters
$stamp : Horde_Kolab_Storage_Folder_Stamp

The current stamp.

$params : array<string|int, mixed> = array()

Additional parameters.

Return values
null —

Search results