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
- $cacheKey : string|null
- $lifetime : int
- $resultCache : CacheItemPoolInterface|null
- __construct() : mixed
- generateCacheKeys() : array<string|int, 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
Methods
__construct()
public
__construct(int $lifetime[, string|null $cacheKey = null ][, CacheItemPoolInterface|Cache|null $resultCache = null ]) : mixed
Parameters
- $lifetime : int
- $cacheKey : string|null = null
- $resultCache : CacheItemPoolInterface|Cache|null = null
Return values
mixed —generateCacheKeys()
Generates the real cache key from query, params, types and connection parameters.
public
generateCacheKeys(string $sql, list<string|int, mixed>|array<string, mixed> $params, array<int, \Doctrine\DBAL\Types\Type|int|string|null>|array<string, \Doctrine\DBAL\Types\Type|int|string|null> $types[, array<string, mixed> $connectionParams = [] ]) : array<string|int, string>
Parameters
- $sql : string
- $params : list<string|int, mixed>|array<string, mixed>
- $types : array<int, \Doctrine\DBAL\Types\Type|int|string|null>|array<string, \Doctrine\DBAL\Types\Type|int|string|null>
- $connectionParams : array<string, mixed> = []
Return values
array<string|int, string> —getCacheKey()
public
getCacheKey() : string
Tags
Return values
string —getLifetime()
public
getLifetime() : int
Return values
int —getResultCache()
public
getResultCache() : CacheItemPoolInterface|null
Return values
CacheItemPoolInterface|null —getResultCacheDriver()
public
getResultCacheDriver() : Cache|null
Tags
Return values
Cache|null —setCacheKey()
public
setCacheKey(string|null $cacheKey) : QueryCacheProfile
Parameters
- $cacheKey : string|null
Return values
QueryCacheProfile —setLifetime()
public
setLifetime(int $lifetime) : QueryCacheProfile
Parameters
- $lifetime : int
Return values
QueryCacheProfile —setResultCache()
public
setResultCache(CacheItemPoolInterface $cache) : QueryCacheProfile
Parameters
- $cache : CacheItemPoolInterface
Return values
QueryCacheProfile —setResultCacheDriver()
public
setResultCacheDriver(Cache $cache) : QueryCacheProfile
Parameters
- $cache : Cache