Documentation

Horde_Kolab_Storage_Cache_Data
in package

A cache backend for Kolab storage data handlers.

Tags
category

Kolab

author

Thomas Jarosch thomas.jarosch@intra2net.com

author

Gunnar Wrobel wrobel@pardus.de

license

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

Table of Contents

B2O  = 'M'
Key for the backend ID to object ID mapping.
DATA_VERSION  = 'D'
Key for the data format version.
DUPLICATES  = 'U'
Key for recording duplicate objects.
ERRORS  = 'E'
Key for recording error objects.
FORMAT_VERSION  = '1'
Holds the version number of the cache format.
ID  = 'I'
Key for the data set parameters associated with this cache.
O2B  = 'B'
Key for the object ID to backend ID mapping.
OBJECTS  = 'O'
Key for the objects.
QUERIES  = 'Q'
Holds query results.
STAMP  = 'P'
Key for the stamp.
SYNC  = 'S'
Key for the last time the data was synchronized.
VERSION  = 'V'
Key for the cache format version.
$_cache  : Horde_Kolab_Storage_Cache
The core cache driver.
$_data  : array<string|int, mixed>
The cache data.
$_data_id  : string
Data ID.
$_parameters  : array<string|int, mixed>
Data parameters that will be recorded in the cache.
__construct()  : mixed
Constructor.
backendMap()  : array<string|int, mixed>
Maps backend IDs to object ids.
getAttachment()  : resource
Retrieves an attachment.
getAttachmentByName()  : array<string|int, mixed>
Retrieves an attachment by name.
getAttachmentByType()  : array<string|int, mixed>
Retrieves an attachment by name.
getBackendToObject()  : array<string|int, mixed>
Returns the backend ID to object ID mapping.
getDataId()  : string
Returns the ID for the data cache.
getDuplicates()  : array<string|int, mixed>
Retrieves the list of object duplicates.
getErrors()  : array<string|int, mixed>
Retrieves the list of object errors.
getLastSync()  : int
Returns the timestamp of the last synchronization.
getObjectByBackendId()  : array<string|int, mixed>
Retrieves the specified object from the cache.
getObjects()  : array<string|int, mixed>
Retrieves the object list from the cache.
getObjectToBackend()  : array<string|int, mixed>
Returns the object ID to backend ID mapping.
getQuery()  : mixed
Returns query information.
getStamp()  : Horde_Kolab_Storage_Folder_Stamp
Retrieves the last stamp.
getVersion()  : string
Retrieves the data version.
hasQuery()  : bool
Is the specified query data available in the cache?
isInitialized()  : bool
Checks if the cache has been initialized.
reset()  : mixed
Initializes the cache structure.
save()  : mixed
Caches the data.
setDataId()  : mixed
Sets the ID for the data cache.
setQuery()  : mixed
Sets query information.
store()  : mixed
Stores the objects list in the cache.
_checkInit()  : mixed
Verifies that the data cache is initialized.
_fetchCacheEntry()  : array<string|int, mixed>
Fetches the specified cache entry in case it is present.
_load()  : mixed
Retrieves the cached list data.

Constants

B2O

Key for the backend ID to object ID mapping.

public mixed B2O = 'M'

DATA_VERSION

Key for the data format version.

public mixed DATA_VERSION = 'D'

DUPLICATES

Key for recording duplicate objects.

public mixed DUPLICATES = 'U'

ERRORS

Key for recording error objects.

public mixed ERRORS = 'E'

FORMAT_VERSION

Holds the version number of the cache format.

public mixed FORMAT_VERSION = '1'

ID

Key for the data set parameters associated with this cache.

public mixed ID = 'I'

O2B

Key for the object ID to backend ID mapping.

public mixed O2B = 'B'

OBJECTS

Key for the objects.

public mixed OBJECTS = 'O'

QUERIES

Holds query results.

public mixed QUERIES = 'Q'

STAMP

Key for the stamp.

public mixed STAMP = 'P'

SYNC

Key for the last time the data was synchronized.

public mixed SYNC = 'S'

VERSION

Key for the cache format version.

public mixed VERSION = 'V'

Properties

$_data

The cache data.

protected array<string|int, mixed> $_data = \false

$_data_id

Data ID.

protected string $_data_id

$_parameters

Data parameters that will be recorded in the cache.

protected array<string|int, mixed> $_parameters

Methods

__construct()

Constructor.

public __construct(Horde_Kolab_Storage_Cache $cache[, array<string|int, mixed> $parameters = null ]) : mixed
Parameters
$cache : Horde_Kolab_Storage_Cache

The core cache driver.

$parameters : array<string|int, mixed> = null

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

Return values
mixed

backendMap()

Maps backend IDs to object ids.

public backendMap(array<string|int, mixed> $backend_ids) : array<string|int, mixed>
Parameters
$backend_ids : array<string|int, mixed>

The list of backend IDs

Return values
array<string|int, mixed>

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

getAttachment()

Retrieves an attachment.

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

Object backend id.

$attachment_id : string

Attachment ID.

Return values
resource

A stream opened to the attachment data.

getAttachmentByName()

Retrieves an attachment by name.

public getAttachmentByName(string $obid, mixed $name) : array<string|int, mixed>
Parameters
$obid : string

Object backend id.

$name : mixed
Return values
array<string|int, mixed>

An array of attachment resources.

getAttachmentByType()

Retrieves an attachment by name.

public getAttachmentByType(string $obid, mixed $type) : array<string|int, mixed>
Parameters
$obid : string

Object backend id.

$type : mixed
Return values
array<string|int, mixed>

An array of attachment resources.

getBackendToObject()

Returns the backend ID to object ID mapping.

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

The mapping.

getDataId()

Returns the ID for the data cache.

public getDataId() : string
Return values
string

The unique ID for the data used when caching it.

getDuplicates()

Retrieves the list of object duplicates.

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

The list of duplicates.

getErrors()

Retrieves the list of object errors.

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

The list of errors.

getLastSync()

Returns the timestamp of the last synchronization.

public getLastSync() : int
Return values
int

Timestamp of the last sync.

getObjectByBackendId()

Retrieves the specified object from the cache.

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

The object ID to fetch.

Return values
array<string|int, mixed>

The list of objects.

getObjects()

Retrieves the object list from the cache.

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

The list of objects.

getObjectToBackend()

Returns the object ID to backend ID mapping.

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

The mapping.

getQuery()

Returns query information.

public getQuery(string $key) : mixed
Parameters
$key : string

The query key.

Return values
mixed

The query data.

getVersion()

Retrieves the data version.

public getVersion() : string
Return values
string

The version of the stored data.

hasQuery()

Is the specified query data available in the cache?

public hasQuery(string $key) : bool
Parameters
$key : string

The query key.

Return values
bool

True in case cached data is available.

isInitialized()

Checks if the cache has been initialized.

public isInitialized() : bool
Return values
bool

True if cache data is available.

reset()

Initializes the cache structure.

public reset() : mixed
Return values
mixed

save()

Caches the data.

public save() : mixed
Return values
mixed

setDataId()

Sets the ID for the data cache.

public setDataId(string $data_id) : mixed
Parameters
$data_id : string

The unique ID for the data used when caching it.

Return values
mixed

setQuery()

Sets query information.

public setQuery(string $key, mixed $data) : mixed
Parameters
$key : string

The query key.

$data : mixed

The query data.

Return values
mixed

store()

Stores the objects list in the cache.

public store(array<string|int, mixed> $objects, Horde_Kolab_Storage_Folder_Stamp $stamp, string $version[, array<string|int, mixed> $delete = array() ]) : mixed
Parameters
$objects : array<string|int, mixed>
$stamp : Horde_Kolab_Storage_Folder_Stamp

The current stamp.

$version : string

The format version of the provided data.

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

Backend IDs that were removed.

Return values
mixed

_checkInit()

Verifies that the data cache is initialized.

protected _checkInit(string $key) : mixed
Parameters
$key : string

The key in the cached data array.

Tags
throws
Horde_Kolab_Storage_Exception

In case the cache has not been initialized.

Return values
mixed

_fetchCacheEntry()

Fetches the specified cache entry in case it is present.

protected _fetchCacheEntry(string $key) : array<string|int, mixed>

Returns an empty array otherwise.

Parameters
$key : string

The key in the cached data array.

Return values
array<string|int, mixed>

The cache entry.

_load()

Retrieves the cached list data.

protected _load() : mixed
Return values
mixed

The data of the object.

Search results