ProxyAdapter
class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterface, ResettableInterface
Traits
An implementation of CacheInterface for PSR-6 CacheItemPoolInterface classes.
Methods
mixed
get(string $key, callable $callback, float $beta = null, array $metadata = null)
Fetches a value from the pool or computes it if not found.
callable
setCallbackWrapper(callable|null $callbackWrapper)
Wraps the callback passed to ->get() in a callable.
from ContractsTrait
__construct(CacheItemPoolInterface $pool, string $namespace = '', int $defaultLifetime = 0)
No description
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}
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.