Constants

B2O

B2O

Key for the backend ID to object ID mapping.

O2B

O2B

Key for the object ID to backend ID mapping.

OBJECTS

OBJECTS

Key for the objects.

DUPLICATES

DUPLICATES

Key for recording duplicate objects.

ERRORS

ERRORS

Key for recording error objects.

STAMP

STAMP

Key for the stamp.

DATA_VERSION

DATA_VERSION

Key for the data format version.

SYNC

SYNC

Key for the last time the data was synchronized.

VERSION

VERSION

Key for the cache format version.

ID

ID

Key for the data set parameters associated with this cache.

FORMAT_VERSION

FORMAT_VERSION

Holds the version number of the cache format.

QUERIES

QUERIES

Holds query results.

Properties

$_parameters

$_parameters : array

Data parameters that will be recorded in the cache.

Type

array

$_data_id

$_data_id : string

Data ID.

Type

string

$_data

$_data : array

The cache data.

Type

array

Methods

__construct()

__construct(\Horde_Kolab_Storage_Cache  $cache, array  $parameters = null) 

Constructor.

Parameters

\Horde_Kolab_Storage_Cache $cache

The core cache driver.

array $parameters

Data set parameters that are only recorded and have no further impact.

setDataId()

setDataId(string  $data_id) 

Sets the ID for the data cache.

Parameters

string $data_id

The unique ID for the data used when caching it.

getDataId()

getDataId() : string

Returns the ID for the data cache.

Returns

string —

The unique ID for the data used when caching it.

save()

save() 

Caches the data.

isInitialized()

isInitialized() : boolean

Checks if the cache has been initialized.

Returns

boolean —

True if cache data is available.

getObjects()

getObjects() : array

Retrieves the object list from the cache.

Returns

array —

The list of objects.

getObjectByBackendId()

getObjectByBackendId(string  $obid) : array

Retrieves the specified object from the cache.

Parameters

string $obid

The object ID to fetch.

Returns

array —

The list of objects.

getObjectToBackend()

getObjectToBackend() : array

Returns the object ID to backend ID mapping.

Returns

array —

The mapping.

getBackendToObject()

getBackendToObject() : array

Returns the backend ID to object ID mapping.

Returns

array —

The mapping.

getVersion()

getVersion() : string

Retrieves the data version.

Returns

string —

The version of the stored data.

getDuplicates()

getDuplicates() : array

Retrieves the list of object duplicates.

Returns

array —

The list of duplicates.

getErrors()

getErrors() : array

Retrieves the list of object errors.

Returns

array —

The list of errors.

getAttachment()

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

Retrieves an attachment.

Parameters

string $obid

Object backend id.

string $attachment_id

Attachment ID.

Returns

resource —

A stream opened to the attachment data.

getAttachmentByName()

getAttachmentByName(string  $obid,   $name) : array

Retrieves an attachment by name.

Parameters

string $obid

Object backend id.

$name

Returns

array —

An array of attachment resources.

getAttachmentByType()

getAttachmentByType(string  $obid,   $type) : array

Retrieves an attachment by name.

Parameters

string $obid

Object backend id.

$type

Returns

array —

An array of attachment resources.

getLastSync()

getLastSync() : integer

Returns the timestamp of the last synchronization.

Returns

integer —

Timestamp of the last sync.

hasQuery()

hasQuery(string  $key) : boolean

Is the specified query data available in the cache?

Parameters

string $key

The query key.

Returns

boolean —

True in case cached data is available.

getQuery()

getQuery(string  $key) : mixed

Returns query information.

Parameters

string $key

The query key.

Returns

mixed —

The query data.

setQuery()

setQuery(string  $key, mixed  $data) 

Sets query information.

Parameters

string $key

The query key.

mixed $data

The query data.

backendMap()

backendMap(array  $backend_ids) : array

Maps backend IDs to object ids.

Parameters

array $backend_ids

The list of backend IDs

Returns

array —

A list that associates object IDs (values) to backend IDs (keys).

store()

store(array  $objects, \Horde_Kolab_Storage_Folder_Stamp  $stamp, string  $version, array  $delete = array()) 

Stores the objects list in the cache.

Parameters

array $objects
\Horde_Kolab_Storage_Folder_Stamp $stamp

The current stamp.

string $version

The format version of the provided data.

array $delete

Backend IDs that were removed.

reset()

reset() 

Initializes the cache structure.

_load()

_load() : mixed

Retrieves the cached list data.

Returns

mixed —

The data of the object.

_fetchCacheEntry()

_fetchCacheEntry(string  $key) : array

Fetches the specified cache entry in case it is present.

Returns an empty array otherwise.

Parameters

string $key

The key in the cached data array.

Returns

array —

The cache entry.

_checkInit()

_checkInit(string  $key) 

Verifies that the data cache is initialized.

Parameters

string $key

The key in the cached data array.

Throws

\Horde_Kolab_Storage_Exception

In case the cache has not been initialized.