class ChainCache implements CacheInterface, PruneableInterface, ResettableInterface

deprecated since Symfony 4.3, use ChainAdapter and type-hint for CacheInterface instead.

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 43
__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 64
get($key, $default = null)

{@inheritdoc}

Parameters

$key
$default

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

{@inheritdoc}

Parameters

$keys
$default

at line 127
has($key)

{@inheritdoc}

Parameters

$key

at line 141
clear()

{@inheritdoc}

at line 156
delete($key)

{@inheritdoc}

Parameters

$key

at line 171
deleteMultiple($keys)

{@inheritdoc}

Parameters

$keys

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

{@inheritdoc}

Parameters

$key
$value
$ttl

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

{@inheritdoc}

Parameters

$values
$ttl

at line 233
bool prune()

Return Value

bool

at line 249
reset()