PHP-Cache > Interfaces > CacheItemInterface
The Bayfront\Cache\Interfaces\CacheItemInterface implements \Psr\Cache\CacheItemPoolInterface.
- getKey
- get
- isHit
- set
- expiresAt
- expiresAfter
- hasExpiration
- getExpirationTimestamp
- getTimeUntilExpiration
- setTags
- addTags
- removeTags
- getRemovedTags
- getTags
- hasTag
- hasAnyTags
- hasAllTags
- setMeta
- addMeta
- removeMeta
- getRemovedMetaKeys
- getMeta
- getMetaValue
- hasMeta
- getHits
- getCreatedAt
- getLastUpdated
- getConfig
- setCompressionMethod
- getCompressionMethod
- setSerializationMethod
- getSerializationMethod
Returns the key for the current cache item.
Parameters:
- None
Returns:
- (string)
Retrieves the value of the item from the cache associated with this object's key.
Parameters:
- None
Returns:
- (mixed)
Confirms if the cache item lookup resulted in a cache hit.
Parameters:
- None
Returns:
- (bool)
Sets the value represented by this cache item.
Parameters:
$value(mixed)
Returns:
- (self)
Sets the expiration time for this cache item.
Passing null will remove any expiration.
Parameters:
$expiration(?DateTimeInterface)
Returns:
- (self)
Sets the expiration time for this cache item.
Passing null will remove any expiration.
Parameters:
$time(DateInterval|int|null): Integer as time in seconds
Returns:
- (self)
Does item have expiration?
Parameters:
- None
Returns:
- (bool)
Get expiration timestamp, or null if no expiration exists.
Parameters:
- None
Returns:
- (int|null)
Get time until expiration (in seconds), or null if no expiration exists.
Parameters:
- None
Returns:
- (int|null)
Set the item's tags, overwriting any which may already exist.
Parameters:
$tags(array)
Returns:
- (self)
Add tags to item.
Parameters:
$tags(array)
Returns:
- (self)
Remove tags from item.
Parameters:
$tags(array)
Returns:
- (self)
Get tags which have been removed from the item since it was retrieved.
Parameters:
- None
Returns:
- (array)
Get item tags.
Parameters:
- None
Returns:
- (array)
Does item have tag?
Parameters:
$tag(string)
Returns:
- (bool)
Does item have any tags?
Parameters:
$tags(array)
Returns:
- (bool)
Does item have all tags?
Parameters:
$tags(array)
Returns:
- (bool)
Set the item's metadata, overwriting any which may already exist.
Parameters:
$meta(array): Key/value pairs
Returns:
- (self)
Add metadata to item.
Parameters:
$meta(array): Key/value pairs
Returns:
- (self)
Remove metadata from item.
Parameters:
$keys(array)
Returns:
- (self)
Get metadata keys which have been removed from the item since it was retrieved.
Parameters:
- None
Returns:
- (array)
Get entire item metadata array.
Parameters:
- None
Returns:
- (array)
Description:
Get metadata value for key.
Parameters:
$key(string): Key in dot notation$default = null(mixed): Default value to return if not existing
Returns:
- (mixed)
Does item have metadata key?
Parameters:
$key(string)
Returns:
- (bool)
Get item hits, or 0 if not yet saved.
A "hit" represents the number of times the item has been retrieved from the pool.
Parameters:
- None
Returns:
- (int)
Get item created at timestamp, or null if not yet saved.
Parameters:
- None
Returns:
- (int|null)
Get item last updated timestamp, or null if not yet saved.
Parameters:
- None
Returns:
- (int|null)
Get item configuration.
Parameters:
- None
Returns:
- (array)
Set compression method for item, if valid. This will override the default compression method used by the adapter.
Parameters:
$method(string)
Returns:
- (self)
Get compression method for item, or null if not set.
Parameters:
- None
Returns:
- (string|null)
Set serialization method for item, if valid. This will override the default serialization method used by the adapter.
Parameters:
$method(string)
Returns:
- (self)
Get serialization method for item, or null if not set.
Parameters:
- None
Returns:
- (string|null)