W3cubDocs

/Symfony 4.1

ChainCache

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)
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()
reset()

Details

__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

get($key, $default = null)

{@inheritdoc}

Parameters

$key
$default

getMultiple($keys, $default = null)

{@inheritdoc}

Parameters

$keys
$default

has($key)

{@inheritdoc}

Parameters

$key

clear()

{@inheritdoc}

delete($key)

{@inheritdoc}

Parameters

$key

deleteMultiple($keys)

{@inheritdoc}

Parameters

$keys

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

{@inheritdoc}

Parameters

$key
$value
$ttl

setMultiple($values, $ttl = null)

{@inheritdoc}

Parameters

$values
$ttl

bool prune()

Return Value

bool

reset()

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Cache/Simple/ChainCache.html