CacheItem
in package
implements
ItemInterface
Tags
Interfaces, Classes and Traits
- ItemInterface
- Augments PSR-6's CacheItemInterface with support for tags and metadata.
Table of Contents
- METADATA_EXPIRY_OFFSET = 1527506807
- $expiry : mixed
- $innerItem : mixed
- $isHit : mixed
- $isTaggable : mixed
- $key : mixed
- $metadata : mixed
- $newMetadata : mixed
- $poolHash : mixed
- $value : mixed
- expiresAfter() : $this
- {@inheritdoc}
- expiresAt() : $this
- {@inheritdoc}
- get() : mixed
- {@inheritdoc}
- getKey() : string
- {@inheritdoc}
- getMetadata() : array<string|int, mixed>
- Returns a list of metadata info that were saved alongside with the cached value.
- isHit() : bool
- {@inheritdoc}
- set() : $this
- {@inheritdoc}
- tag() : $this
- Adds a tag to a cache item.
- validateKey() : string
- Validates a cache key according to PSR-6.
Constants
METADATA_EXPIRY_OFFSET
private
mixed
METADATA_EXPIRY_OFFSET
= 1527506807
Properties
$expiry
protected
mixed
$expiry
$innerItem
protected
mixed
$innerItem
$isHit
protected
mixed
$isHit
= false
$isTaggable
protected
mixed
$isTaggable
= false
$key
protected
mixed
$key
$metadata
protected
mixed
$metadata
= []
$newMetadata
protected
mixed
$newMetadata
= []
$poolHash
protected
mixed
$poolHash
$value
protected
mixed
$value
Methods
expiresAfter()
{@inheritdoc}
public
expiresAfter(mixed $time) : $this
Parameters
- $time : mixed
Return values
$this —expiresAt()
{@inheritdoc}
public
expiresAt(mixed $expiration) : $this
Parameters
- $expiration : mixed
Return values
$this —get()
{@inheritdoc}
public
get() : mixed
Return values
mixed —getKey()
{@inheritdoc}
public
getKey() : string
Return values
string —getMetadata()
Returns a list of metadata info that were saved alongside with the cached value.
public
getMetadata() : array<string|int, mixed>
Return values
array<string|int, mixed> —isHit()
{@inheritdoc}
public
isHit() : bool
Return values
bool —set()
{@inheritdoc}
public
set(mixed $value) : $this
Parameters
- $value : mixed
Return values
$this —tag()
Adds a tag to a cache item.
public
tag(mixed $tags) : $this
Parameters
- $tags : mixed
-
A tag or array of tags
Return values
$this —validateKey()
Validates a cache key according to PSR-6.
public
static validateKey(mixed $key) : string
Parameters
- $key : mixed
-
The key to validate