\Horde_Kolab_Storage_Cache

The Kolab_Cache class provides a cache for Kolab groupware objects.

The Horde_Kolab_Storage_Cache singleton instance provides caching for all storage folders. So before operating on the cache data it is necessary to load the desired folder data. Before switching the folder the cache data should be saved.

This class does not offer a lot of safeties and is primarily intended to be used within the Horde_Kolab_Storage_Data class.

Copyright 2007-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.

Summary

Methods
Properties
Constants
__construct()
getDataCache()
loadData()
storeData()
loadAttachment()
storeAttachment()
deleteAttachment()
loadList()
storeList()
requireParameter()
No public properties found
No constants found
No protected methods found
$_horde_cache
$_data_caches
N/A
_getDataId()
_getAttachmentId()
No private properties found
N/A

Properties

$_horde_cache

$_horde_cache : \Horde_Cache

The link to the horde cache.

Type

\Horde_Cache

$_data_caches

$_data_caches : array

Data cache instances.

Type

array

Methods

__construct()

__construct(\Horde_Cache  $cache) 

Constructor.

Parameters

\Horde_Cache $cache

The global cache for temporary data storage.

getDataCache()

getDataCache(array  $data_params) : \Horde_Kolab_Storage_Cache_Data

Return a data cache.

Parameters

array $data_params

Return the data cache for a data set with these parameters.

Returns

\Horde_Kolab_Storage_Cache_Data

The data cache.

loadData()

loadData(string  $data_id) : string

Retrieve data set.

Parameters

string $data_id

ID of the data set.

Returns

string —

The cached data set.

storeData()

storeData(string  $data_id, string  $data) 

Cache data set.

Parameters

string $data_id

ID of the data set.

string $data

The data to be cached.

loadAttachment()

loadAttachment(string  $data_id, string  $obid, string  $attachment_id) : resource

Retrieve an attachment.

Parameters

string $data_id

ID of the data set.

string $obid

Object backend id.

string $attachment_id

Attachment ID.

Returns

resource —

A stream opened to the attachment data.

storeAttachment()

storeAttachment(string  $data_id, string  $obid, string  $attachment_id, resource  $data) 

Store an attachment.

Parameters

string $data_id

ID of the data set.

string $obid

Object backend id.

string $attachment_id

Attachment ID.

resource $data

A stream opened to the attachment data.

deleteAttachment()

deleteAttachment(string  $data_id, string  $obid, string  $attachment_id) 

Delete a cached attachment.

Parameters

string $data_id

ID of the data set.

string $obid

Object backend id.

string $attachment_id

Attachment ID.

loadList()

loadList(string  $list_id) : string

Retrieve list data.

Parameters

string $list_id

ID of the connection matching the list.

Returns

string —

The data of the object.

storeList()

storeList(string  $list_id, string  $data) 

Cache list data.

Parameters

string $list_id

ID of the connection matching the list.

string $data

The data to be cached.

requireParameter()

requireParameter(  $parameters,   $type,   $key) 

Determine if a necessary parameter is set.

Parameters

$parameters
$type
$key

Throws

\Horde_Kolab_Storage_Exception

In case the parameter is missing.

_getDataId()

_getDataId(array  $data_params) : string

Compose the data key.

Parameters

array $data_params

Return the data ID for a data set with these parameters.

Returns

string —

The data cache ID.

_getAttachmentId()

_getAttachmentId(string  $data_id, string  $obid, string  $attachment_id) : string

Compose the attachment key.

Parameters

string $data_id

ID of the data set.

string $obid

Object backend id.

string $attachment_id

Attachment ID.

Returns

string —

The attachment cache ID.