ChainAdapter

class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableInterface

Chains several adapters together.

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

Methods

__construct(array $adapters, int $maxLifetime)
CacheItem getItem($key)

{@inheritdoc}

getItems(array $keys = array())

{@inheritdoc}

hasItem($key)

{@inheritdoc}

clear()

{@inheritdoc}

deleteItem($key)

{@inheritdoc}

deleteItems(array $keys)

{@inheritdoc}

save(CacheItemInterface $item)

{@inheritdoc}

saveDeferred(CacheItemInterface $item)

{@inheritdoc}

commit()

{@inheritdoc}

bool prune()
reset()

Details

__construct(array $adapters, int $maxLifetime)

Parameters

array $adapters The ordered list of adapters used to fetch cached items
int $maxLifetime The max lifetime of items propagated from lower adapters to upper ones

CacheItem getItem($key)

{@inheritdoc}

Parameters

$key

Return Value

CacheItem

getItems(array $keys = array())

{@inheritdoc}

return \Traversable|CacheItem[]

Parameters

array $keys

hasItem($key)

{@inheritdoc}

Parameters

$key

clear()

{@inheritdoc}

deleteItem($key)

{@inheritdoc}

Parameters

$key

deleteItems(array $keys)

{@inheritdoc}

Parameters

array $keys

save(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

saveDeferred(CacheItemInterface $item)

{@inheritdoc}

Parameters

CacheItemInterface $item

commit()

{@inheritdoc}

bool prune()

Return Value

bool

reset()

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Cache/Adapter/ChainAdapter.html