Stud.IP
6.0
|
Public Member Functions | |
__construct (string $key, mixed $value=null, ?int $expiration=null, bool $cache_hit=false) | |
getKey () | |
get () | |
isHit () | |
set ($value) | |
expiresAt ($expiration) | |
expiresAfter ($time) | |
setHit () | |
getExpiration () | |
getExpirationInSeconds () | |
Protected Attributes | |
string | $key |
mixed | $value |
DateTime | $expiration = null |
bool | $cache_hit = false |
implements the CacheItemInterface of PSR-6. It holds the value and the key of a cache item and also provides additional methods to get the expiration of the item.
__construct | ( | string | $key, |
mixed | $value = null , |
||
?int | $expiration = null , |
||
bool | $cache_hit = false |
||
) |
The constructor of .
string | $key | The key of the item in the cache. |
mixed | $value | The value of the item. |
int | null | $expiration | The expiration of the item in seconds, if applicable. |
bool | $cache_hit | Whether the item shall be constructed as cache hit (true) or not (false). |
expiresAfter | ( | $time | ) |
expiresAt | ( | $expiration | ) |
get | ( | ) |
getExpiration | ( | ) |
Returns the expiration, if set.
getExpirationInSeconds | ( | ) |
Returns the seconds from the current timestamp until the expiration of the item.
getKey | ( | ) |
isHit | ( | ) |
set | ( | $value | ) |
setHit | ( | ) |
Sets the item to be a cache hit.
|
protected |
|
protected |
|
protected |
|
protected |