Method |
Description |
|
clear ( ) : boolean |
Clears the current Item. If hierarchical or "stackable" caching is being
used this function will also remove children Items. |
|
disable ( ) : boolean |
This disables any IO operations by this object, effectively preventing
the reading and writing of new data. |
|
expiresAfter ( integer | DateInterval $time ) : self |
Sets the expiration based off of an integer or DateInterval |
|
expiresAt ( DateTimeInterface $expiration ) : self |
Sets the expiration to a specific time. |
|
extend ( null $ttl = null ) : boolean |
Extends the expiration on the current cached item. For some engines this
can be faster than storing the item again. |
|
get ( ) : mixed |
Returns the data retrieved from the cache. Since this can return false or
null as a correctly cached value, the return value should not be used to
determine successful retrieval of data- for that use the "isMiss()"
function after call this one. If no value is stored at all then this
function will return null. |
|
getCreation ( ) : DateTime |
Returns the record's creation time or false if it isn't set |
|
getExpiration ( ) : DateTime |
Returns the record's expiration timestamp or false if no expiration timestamp is set |
|
getKey ( ) : string |
Returns the key as a string. This is particularly useful when the Item is
returned as a group of Items in an Iterator. |
|
isDisabled ( ) : boolean |
Return true if caching is disabled |
|
isHit ( ) : boolean |
Returns true if the cached item is valid and usable. |
|
isMiss ( ) : boolean |
Returns true if the cached item needs to be refreshed. |
|
lock ( null $ttl = null ) : boolean |
Enables stampede protection by marking this specific instance of the Item
as the one regenerating the cache. |
|
save ( ) : boolean |
Persists the Item's value to the backend storage. |
|
set ( mixed $value ) : self |
Takes and stores data for later retrieval. This data can be any php data,
including arrays and object, except resources and objects which are
unable to be serialized. |
|
setInvalidationMethod ( integer $invalidation, mixed $arg = null, mixed $arg2 = null ) |
Set the cache invalidation method for this item. |
|
setKey ( array $key, string | null $namespace = null ) |
Takes and sets the key and namespace. |
|
setLogger ( PSR\Log\LoggerInterface $logger ) : boolean |
Sets a PSR\Logger style logging client to enable the tracking of errors. |
|
setPool ( Stash\Interfaces\PoolInterface $driver ) |
Sets the Parent Pool for the Item class to use. |
|
setTTL ( mixed $ttl = null ) : self |
Sets the expiration based off a an integer, date interval, or date |
|