CacheItem
in package
implements
ItemInterface
FinalYes
Tags
Table of Contents
Interfaces
- ItemInterface
- Augments PSR-6's CacheItemInterface with support for tags and metadata.
Constants
- METADATA_EXPIRY_OFFSET = 1527506807
Properties
- $expiry : float|int|null
- $innerItem : mixed
- $isHit : bool
- $isTaggable : bool
- $key : string
- $metadata : array<string|int, mixed>
- $newMetadata : array<string|int, mixed>
- $poolHash : string|null
- $value : mixed
Methods
- 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
float|int|null
$expiry
= null
$innerItem
protected
mixed
$innerItem
= null
$isHit
protected
bool
$isHit
= false
$isTaggable
protected
bool
$isTaggable
= false
$key
protected
string
$key
$metadata
protected
array<string|int, mixed>
$metadata
= []
$newMetadata
protected
array<string|int, mixed>
$newMetadata
= []
$poolHash
protected
string|null
$poolHash
= null
$value
protected
mixed
$value
= null
Methods
expiresAfter()
{@inheritdoc}
public
expiresAfter(mixed $time) : $this
Parameters
- $time : mixed
Return values
$thisexpiresAt()
{@inheritdoc}
public
expiresAt(DateTimeInterface|null $expiration) : $this
Parameters
- $expiration : DateTimeInterface|null
Return values
$thisget()
{@inheritdoc}
public
get() : mixed
getKey()
{@inheritdoc}
public
getKey() : string
Return values
stringgetMetadata()
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
boolset()
{@inheritdoc}
public
set(mixed $value) : $this
Parameters
- $value : mixed
Return values
$thistag()
Adds a tag to a cache item.
public
tag(mixed $tags) : $this
Parameters
- $tags : mixed
-
A tag or array of tags
Return values
$thisvalidateKey()
Validates a cache key according to PSR-6.
public
static validateKey(mixed $key) : string
Parameters
- $key : mixed
-
The key to validate