CacheInterface
interface CacheInterface
Covers most simple to advanced caching needs.
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.
bool
delete(string $key)
Removes an item from the pool.
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.