ChainAdapter
class ChainAdapter implements AdapterInterface, CacheInterface, 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.
Traits
Methods
Fetches a value from the pool or computes it if not found.
Wraps the callback passed to ->get() in a callable.
No description
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
No description
No description
Details
mixed
get(string $key, callable $callback, float $beta = null, array $metadata = null)
Fetches a value from the pool or computes it if not found.
On cache misses, a callback is called that should return the missing value. This callback is given a PSR-6 CacheItemInterface instance corresponding to the requested key, that could be used e.g. for expiration control. It could also be an ItemInterface instance when its additional features are needed.