class ChainCache implements CacheInterface, PruneableInterface, ResettableInterface

Chains several caches together.

Cached items are fetched from the first cache having them in its data store. They are saved and deleted in all caches at once.

Methods

__construct(array $caches, int $defaultLifetime = 0)

No description

get($key, $default = null)

{@inheritdoc}

getMultiple($keys, $default = null)

{@inheritdoc}

has($key)

{@inheritdoc}

clear()

{@inheritdoc}

delete($key)

{@inheritdoc}

deleteMultiple($keys)

{@inheritdoc}

set($key, $value, $ttl = null)

{@inheritdoc}

setMultiple($values, $ttl = null)

{@inheritdoc}

bool
prune()

No description

reset()

No description

Details

at line 39
__construct(array $caches, int $defaultLifetime = 0)

Parameters

array $caches The ordered list of caches used to fetch cached items
int $defaultLifetime The lifetime of items propagated from lower caches to upper ones

at line 60
get($key, $default = null)

{@inheritdoc}

Parameters

$key
$default

at line 82
getMultiple($keys, $default = null)

{@inheritdoc}

Parameters

$keys
$default

at line 123
has($key)

{@inheritdoc}

Parameters

$key

at line 137
clear()

{@inheritdoc}

at line 152
delete($key)

{@inheritdoc}

Parameters

$key

at line 167
deleteMultiple($keys)

{@inheritdoc}

Parameters

$keys

at line 185
set($key, $value, $ttl = null)

{@inheritdoc}

Parameters

$key
$value
$ttl

at line 200
setMultiple($values, $ttl = null)

{@inheritdoc}

Parameters

$values
$ttl

at line 229
bool prune()

Return Value

bool

at line 245
reset()