Handles caching queries and loading results from the cache.
Used by {@link \Cake\Datasource\QueryTrait} internally.
Constructor.
Get the cache engine.
Get/generate the cache key.
Load the cached results from the cache or run the query.
Store the result set into the cache.
__construct(Closure|string $key, Psr\SimpleCache\CacheInterface|string $config)
Constructor.
Closure|string $key The key or function to generate a key.
Psr\SimpleCache\CacheInterface|string $config The cache config name or cache engine instance.
RuntimeException_resolveCacher(): Psr\SimpleCache\CacheInterface
Get the cache engine.
Psr\SimpleCache\CacheInterface_resolveKey(object $query): string
Get/generate the cache key.
object $query The query to generate a key for.
stringRuntimeExceptionfetch(object $query): mixed|null
Load the cached results from the cache or run the query.
object $query The query the cache read is for.
mixed|nullstore(object $query, Traversable $results): bool
Store the result set into the cache.
object $query The query the cache read is for.
Traversable $results The result set to store.
boolConfig for cache engine.
Psr\SimpleCache\CacheInterface|stringThe key or function to generate a key.
Closure|string
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Datasource.QueryCacher.html