Property | Type | Description | |
---|---|---|---|
$data | array | The actual cached data | |
$dependencies | array:CacheKey | This is a storage of dependencies for this cache. This is stored here as the russian doll model will automatically push up dependencies. In the end this will probably be used by the storage for easy invalidation. | |
$key | |||
$lifetime | integer | Lifetime: how long this cache should live. It's up to the storage implementation the details of how this will be obeyed, if at all. |
Method | Description | |
---|---|---|
__construct ( |
||
addDependencies ( array $deps ) : |
Adds a dependency | |
addDependency ( |
Adds a dependency | |
appendCallback ( callable $callback ) : |
||
appendData ( mixed $data ) : |
||
appendRecursion ( |
||
appendRecursionData ( |
||
checkClash ( |
Checks if a set of keys clashes with the ones used here. | |
checkUpdateToDate ( |
Checks if dependencies are still fresh. | |
clearDependenciesHash ( ) | ||
dependencyInit ( |
Init dependencies. If increment is not supported by backend return 0. | |
generateDependenciesHash ( |
Get a fresh hash based on dependencies. Does not update the current hash. | |
getDependencies ( ) | ||
getDependenciesHash ( ) | ||
getFirstData ( ) : any | null | Convenience function. Returns the first data self::CACHEDATA_TYPE_DATA that you stored. Returns null if there is none. | |
getKey ( ) | ||
mergeDependencies ( |
||
serialize ( ) : string | Serialize this object to a string so we can easily store. | |
setDependencies ( array $deps, |
Sets the list of dependencies and updates the dependency hash | |
setKey ( |
||
setLifetime ( integer $lifetime ) : |
||
stringify ( |
Converts this data to a string that can output. This is not a hash key or a serialization, but an actual render for humans. | |
unserialize ( string $data ) : |
Unserializes data and returns a new CacheData. This is what you should use to get the object data from the storage. | |
updateDependenciesHash ( |
||
updateDependenciesHashIfNull ( |
public addDependencies ( array $deps ) : |
||
$deps | array | |
return | This |
public addDependency ( |
||
$k | ||
return | This |
public appendCallback ( callable $callback ) : |
||
$callback | callable | |
return |
public appendData ( mixed $data ) : |
||
$data | mixed | Any kind of data you want to store. usually strings. |
return |
public checkClash ( |
||
$k | ||
return | boolean | True if they match and there is a clash |
public checkUpdateToDate ( |
||
$cache | ||
return | boolean |
public dependencyInit ( |
||
$cache | ||
$k | ||
return | integer |
public generateDependenciesHash ( |
||
$cache | ||
return | string |
public getFirstData ( ) : any | null | ||
return | any | null |
public mergeDependencies ( |
||
$cd | ||
return |
public setDependencies ( array $deps, |
||
$deps | array | |
$cache | ||
return |
public setLifetime ( integer $lifetime ) : |
||
$lifetime | integer | |
return |
public stringify ( |
||
$c |
public static unserialize ( string $data ) : |
||
$data | string | |
return |
public updateDependenciesHash ( |
||
$cache |
public updateDependenciesHashIfNull ( |
||
$cache |
public array:CacheKey $dependencies | ||
return | array:CacheKey |
public int $lifetime | ||
return | integer |