class CacheItem implements CacheItemInterface (View source)

A cache item (entry).

This is not to be created by user libraries. Instead request an item from the pool (frontend).

Properties

protected string $key
protected mixed $value
protected bool $hit
protected DateTime|null $expirationDate

Methods

__construct(string $key, bool $hit, mixed $value = null)

Construct item.

string
getKey()

No description

mixed
get()

No description

bool
isHit()

No description

set(mixed $value)

No description

expiresAt(DateTimeInterface|null $expiration)

No description

expiresAfter(DateInterval|int|null $time)

No description

DateTime|null
getExpirationDate()

No description

Details

__construct(string $key, bool $hit, mixed $value = null)

Construct item.

Parameters

string $key
bool $hit
mixed $value

string getKey()

No description

Return Value

string

mixed get()

No description

Return Value

mixed

bool isHit()

No description

Return Value

bool

CacheItem|CacheItem set(mixed $value)

No description

Parameters

mixed $value

Return Value

CacheItem|CacheItem

CacheItem|CacheItem expiresAt(DateTimeInterface|null $expiration)

No description

Parameters

DateTimeInterface|null $expiration

Return Value

CacheItem|CacheItem

CacheItem|CacheItem expiresAfter(DateInterval|int|null $time)

No description

Parameters

DateInterval|int|null $time

Return Value

CacheItem|CacheItem

DateTime|null getExpirationDate()

No description

Return Value

DateTime|null