Skip to content

Item

Constants

Constant Visibility Type Value
EXPIRATION public 'now +100 years'

Properties

expiration

protected \DateTimeInterface|\DateInterval|int|null $expiration

key

private string $key

value

private mixed $value

isHit

private bool $isHit

Methods

__construct

public __construct(string $key, mixed $value = null, ?\DateTimeInterface $ttl = null, bool $isHit = false): mixed

Parameters:

Parameter Type Description
$key string Cache key.
$value mixed Cache value.
$ttl ?\DateTimeInterface
$isHit bool

getKey

{@inheritdoc}

public getKey(): string

get

{@inheritdoc}

public get(): mixed

isHit

{@inheritdoc}

public isHit(): bool

set

{@inheritdoc}

public set(mixed $value): static

Parameters:

Parameter Type Description
$value mixed

setHit

Set whether it's a cache hit or not.

public setHit(bool $value): static

Parameters:

Parameter Type Description
$value bool False or true.

expiresAt

{@inheritdoc}

public expiresAt(?\DateTimeInterface $expiration): static

Parameters:

Parameter Type Description
$expiration ?\DateTimeInterface

expiresAfter

{@inheritdoc}

public expiresAfter(int|\DateInterval|null $time): static

Parameters:

Parameter Type Description
$time int|\DateInterval|null

getExpiresAt

Returns a DateInterval object.

public getExpiresAt(): \DateTime|\DateInterval|\Qubus\Support\DateTime\QubusDateTimeImmutable

getExpiresInSeconds

Returns the number of seconds a cache should expire.

public getExpiresInSeconds(): int

isExpired

Returns true if expired, false otherwise.

public isExpired(): bool


Automatically generated on 2025-10-13