QueryCacheProfile
in package
Query Cache Profile handles the data relevant for query caching.
It is a value object, setter methods return NEW instances.
Table of Contents
Properties
- $cacheKey : string|null
- $lifetime : int
- $resultCache : CacheItemPoolInterface|null
Methods
- __construct() : mixed
- generateCacheKeys() : array{: string, : string}
- Generates the real cache key from query, params, types and connection parameters.
- getCacheKey() : string
- getLifetime() : int
- getResultCache() : CacheItemPoolInterface|null
- getResultCacheDriver() : Cache|null
- setCacheKey() : QueryCacheProfile
- setLifetime() : QueryCacheProfile
- setResultCache() : QueryCacheProfile
- setResultCacheDriver() : QueryCacheProfile
Properties
$cacheKey
private
string|null
$cacheKey
$lifetime
private
int
$lifetime
$resultCache
private
CacheItemPoolInterface|null
$resultCache
= null
Methods
__construct()
public
__construct([int $lifetime = 0 ][, string|null $cacheKey = null ][, CacheItemPoolInterface|Cache|null $resultCache = null ]) : mixed
Parameters
- $lifetime : int = 0
- $cacheKey : string|null = null
- $resultCache : CacheItemPoolInterface|Cache|null = null
generateCacheKeys()
Generates the real cache key from query, params, types and connection parameters.
public
generateCacheKeys(string $sql, array<int, mixed>|array<string, mixed> $params, array<int, Type|int|string|null>|array<string, Type|int|string|null> $types[, array<string, mixed> $connectionParams = [] ]) : array{: string, : string}
Parameters
- $sql : string
- $params : array<int, mixed>|array<string, mixed>
- $types : array<int, Type|int|string|null>|array<string, Type|int|string|null>
- $connectionParams : array<string, mixed> = []
Return values
array{: string, : string}getCacheKey()
public
getCacheKey() : string
Tags
Return values
stringgetLifetime()
public
getLifetime() : int
Return values
intgetResultCache()
public
getResultCache() : CacheItemPoolInterface|null
Return values
CacheItemPoolInterface|nullgetResultCacheDriver()
public
getResultCacheDriver() : Cache|null
Tags
Return values
Cache|nullsetCacheKey()
public
setCacheKey(string|null $cacheKey) : QueryCacheProfile
Parameters
- $cacheKey : string|null
Return values
QueryCacheProfilesetLifetime()
public
setLifetime(int $lifetime) : QueryCacheProfile
Parameters
- $lifetime : int
Return values
QueryCacheProfilesetResultCache()
public
setResultCache(CacheItemPoolInterface $cache) : QueryCacheProfile
Parameters
- $cache : CacheItemPoolInterface
Return values
QueryCacheProfilesetResultCacheDriver()
public
setResultCacheDriver(Cache $cache) : QueryCacheProfile
Parameters
- $cache : Cache