Item
class Item implements CacheItemInterface (View source)
A cache item.
Methods
No description
Returns the key for the current cache item.
Retrieves the value of the item from the cache associated with this object's key.
Confirms if the cache item lookup resulted in a cache hit.
Sets the value represented by this cache item.
No description
Details
at line 50
__construct(string $key)
at line 58
string
getKey()
Returns the key for the current cache item.
The key is loaded by the Implementing Library, but should be available to the higher level callers when needed.
at line 66
mixed
get()
Retrieves the value of the item from the cache associated with this object's key.
The value returned must be identical to the value originally stored by set().
If isHit() returns false, this method MUST return null. Note that null is a legitimate cached value, so the isHit() method SHOULD be used to differentiate between "null value was found" and "no value was found."
at line 74
bool
isHit()
Confirms if the cache item lookup resulted in a cache hit.
Note: This method MUST NOT have a race condition between calling isHit() and calling get().
at line 90
CacheItemInterface
set(mixed $value)
Sets the value represented by this cache item.
The $value argument may be any item that can be serialized by PHP, although the method of serialization is left up to the Implementing Library.
at line 101
CacheItemInterface
expiresAt(DateTimeInterface|null $expiration)
Sets the expiration time for this cache item.
at line 126
CacheItemInterface
expiresAfter(int|DateInterval|null $time)
Sets the expiration time for this cache item.