PHP Class Horde_Kolab_Storage_Cache_Data, horde

Author: Thomas Jarosch ([email protected])
Author: Gunnar Wrobel ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_cache Horde_Kolab_Storage_Cache The core cache driver.
$_data array The cache data.
$_data_id string Data ID.
$_parameters array Data parameters that will be recorded in the cache.

Public Methods

Method Description
__construct ( Horde_Kolab_Storage_Cache $cache, array $parameters = null ) Constructor.
backendMap ( array $backend_ids ) : array Maps backend IDs to object ids.
getAttachment ( string $obid, string $attachment_id ) : resource Retrieves an attachment.
getAttachmentByName ( string $obid, $name ) : array Retrieves an attachment by name.
getAttachmentByType ( string $obid, $type ) : array Retrieves an attachment by name.
getBackendToObject ( ) : array Returns the backend ID to object ID mapping.
getDataId ( ) : string Returns the ID for the data cache.
getDuplicates ( ) : array Retrieves the list of object duplicates.
getErrors ( ) : array Retrieves the list of object errors.
getLastSync ( ) : integer Returns the timestamp of the last synchronization.
getObjectByBackendId ( string $obid ) : array Retrieves the specified object from the cache.
getObjectToBackend ( ) : array Returns the object ID to backend ID mapping.
getObjects ( ) : array Retrieves the object list from the cache.
getQuery ( string $key ) : mixed Returns query information.
getStamp ( ) : Horde_Kolab_Storage_Folder_Stamp Retrieves the last stamp.
getVersion ( ) : string Retrieves the data version.
hasQuery ( string $key ) : boolean Is the specified query data available in the cache?
isInitialized ( ) : boolean Checks if the cache has been initialized.
reset ( ) Initializes the cache structure.
save ( ) Caches the data.
setDataId ( string $data_id ) Sets the ID for the data cache.
setQuery ( string $key, mixed $data ) Sets query information.
store ( array $objects, Horde_Kolab_Storage_Folder_Stamp $stamp, string $version, array $delete = [] ) Stores the objects list in the cache.

Protected Methods

Method Description
_checkInit ( string $key ) Verifies that the data cache is initialized.
_fetchCacheEntry ( string $key ) : array Fetches the specified cache entry in case it is present.
_load ( ) : mixed Retrieves the cached list data.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Kolab_Storage_Cache $cache, array $parameters = null )
$cache Horde_Kolab_Storage_Cache The core cache driver.
$parameters array Data set parameters that are only recorded and have no further impact.

_checkInit() protected method

Verifies that the data cache is initialized.
protected _checkInit ( string $key )
$key string The key in the cached data array.

_fetchCacheEntry() protected method

Returns an empty array otherwise.
protected _fetchCacheEntry ( string $key ) : array
$key string The key in the cached data array.
return array The cache entry.

_load() protected method

Retrieves the cached list data.
protected _load ( ) : mixed
return mixed The data of the object.

backendMap() public method

Maps backend IDs to object ids.
public backendMap ( array $backend_ids ) : array
$backend_ids array The list of backend IDs
return array A list that associates object IDs (values) to backend IDs (keys).

getAttachment() public method

Retrieves an attachment.
public getAttachment ( string $obid, string $attachment_id ) : resource
$obid string Object backend id.
$attachment_id string Attachment ID.
return resource A stream opened to the attachment data.

getAttachmentByName() public method

Retrieves an attachment by name.
public getAttachmentByName ( string $obid, $name ) : array
$obid string Object backend id.
return array An array of attachment resources.

getAttachmentByType() public method

Retrieves an attachment by name.
public getAttachmentByType ( string $obid, $type ) : array
$obid string Object backend id.
return array An array of attachment resources.

getBackendToObject() public method

Returns the backend ID to object ID mapping.
public getBackendToObject ( ) : array
return array The mapping.

getDataId() public method

Returns the ID for the data cache.
public getDataId ( ) : string
return string The unique ID for the data used when caching it.

getDuplicates() public method

Retrieves the list of object duplicates.
public getDuplicates ( ) : array
return array The list of duplicates.

getErrors() public method

Retrieves the list of object errors.
public getErrors ( ) : array
return array The list of errors.

getLastSync() public method

Returns the timestamp of the last synchronization.
public getLastSync ( ) : integer
return integer Timestamp of the last sync.

getObjectByBackendId() public method

Retrieves the specified object from the cache.
public getObjectByBackendId ( string $obid ) : array
$obid string The object ID to fetch.
return array The list of objects.

getObjectToBackend() public method

Returns the object ID to backend ID mapping.
public getObjectToBackend ( ) : array
return array The mapping.

getObjects() public method

Retrieves the object list from the cache.
public getObjects ( ) : array
return array The list of objects.

getQuery() public method

Returns query information.
public getQuery ( string $key ) : mixed
$key string The query key.
return mixed The query data.

getStamp() public method

Retrieves the last stamp.
public getStamp ( ) : Horde_Kolab_Storage_Folder_Stamp
return Horde_Kolab_Storage_Folder_Stamp The last recorded stamp.

getVersion() public method

Retrieves the data version.
public getVersion ( ) : string
return string The version of the stored data.

hasQuery() public method

Is the specified query data available in the cache?
public hasQuery ( string $key ) : boolean
$key string The query key.
return boolean True in case cached data is available.

isInitialized() public method

Checks if the cache has been initialized.
public isInitialized ( ) : boolean
return boolean True if cache data is available.

reset() public method

Initializes the cache structure.
public reset ( )

save() public method

Caches the data.
public save ( )

setDataId() public method

Sets the ID for the data cache.
public setDataId ( string $data_id )
$data_id string The unique ID for the data used when caching it.

setQuery() public method

Sets query information.
public setQuery ( string $key, mixed $data )
$key string The query key.
$data mixed The query data.

store() public method

Stores the objects list in the cache.
public store ( array $objects, Horde_Kolab_Storage_Folder_Stamp $stamp, string $version, array $delete = [] )
$objects array
$stamp Horde_Kolab_Storage_Folder_Stamp The current stamp.
$version string The format version of the provided data.
$delete array Backend IDs that were removed.

Property Details

$_cache protected property

The core cache driver.
protected Horde_Kolab_Storage_Cache $_cache
return Horde_Kolab_Storage_Cache

$_data protected property

The cache data.
protected array $_data
return array

$_data_id protected property

Data ID.
protected string $_data_id
return string

$_parameters protected property

Data parameters that will be recorded in the cache.
protected array $_parameters
return array