eZPublishCommunityProject(LegacyStack)  2013.5
ezpRestCacheStorageClusterObject Class Reference

Cache storage implementation for compatible objects (implementing ezcBaseExportable interface). More...

+ Inheritance diagram for ezpRestCacheStorageClusterObject:
+ Collaboration diagram for ezpRestCacheStorageClusterObject:

Protected Member Functions

 fetchData ($filename)
 Fetch data from the cache. More...
 
 prepareData ($data)
 Serialize the data for storing. More...
 

Additional Inherited Members

- Public Member Functions inherited from ezpRestCacheStorageCluster
 __construct ($location, $options=array())
 Creates a new cache storage for a given location through eZ Publish cluster mechanism Options can contain the 'ttl' ( Time-To-Life ). More...
 
 abortCacheGeneration ()
 Aborts current cache generation Useful in case of a problem during generation of content (ie. More...
 
 clusterRetrieve ($file, $mtime, $args)
 Retrieve callback for cluster processCache() method. More...
 
 countDataItems ($id=null, $attributes=array())
 Return the number of items in the cache matching a certain criteria. More...
 
 delete ($id=null, $attributes=array(), $search=false)
 Delete data from the cache. More...
 
 getRemainingLifetime ($id, $attributes=array())
 Returns the time ( in seconds ) that remains for a cache object, before it gets outdated. More...
 
 restore ($id, $attributes=array(), $search=false)
 Restore data from the cache. More...
 
 store ($id, $data, $attributes=array())
 (non-PHPdoc) More...
 
- Public Attributes inherited from ezpRestCacheStorageCluster
 $isCacheEnabled = true
 
- Protected Attributes inherited from ezpRestCacheStorageCluster
 $clusterCacheFile
 

Detailed Description

Cache storage implementation for compatible objects (implementing ezcBaseExportable interface).

Will also work with arrays and scalar values (int, float, string, bool)

Member Function Documentation

ezpRestCacheStorageClusterObject::fetchData (   $filename)
protected

Fetch data from the cache.

This method fetches the desired data from the file with $filename from disk. This implementation uses an include statement for fetching. The return value depends on the stored data and might either be an object implementing ezcBaseExportable, an array or a scalar value.

Parameters
string$filename
Returns
mixed
ezpRestCacheStorageClusterObject::prepareData (   $data)
protected

Serialize the data for storing.

Serializes the given $data to a executable PHP code representation string. This works with objects implementing ezcBaseExportable, arrays and scalar values (int, bool, float, string). The return value is executable PHP code to be stored to disk. The data can be unserialized using the fetchData() method.

Parameters
mixed$data
Returns
string
Exceptions
ezcCacheInvalidDataExceptionif the $data can not be serialized (e.g. an object that does not implement ezcBaseExportable, a resource, ...).

The documentation for this class was generated from the following file: