Documentation

CacheItem
in package
implements ItemInterface

Tags
author

Nicolas Grekas p@tchwork.com

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

$isTaggable

protected mixed $isTaggable = false

$newMetadata

protected mixed $newMetadata = []

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

Tags
throws
InvalidArgumentException

When $key is not valid

Return values
string

Search results