QueryCacheProfile
in package
Query Cache Profile handles the data relevant for query caching.
It is a value object, setter methods return NEW instances.
Tags
Table of Contents
- $cacheKey : string|null
- $lifetime : int
- $resultCacheDriver : Cache|null
- __construct() : mixed
- generateCacheKeys() : array<string|int, mixed>
- Generates the real cache key from query, params and types.
- getCacheKey() : string
- getLifetime() : int
- getResultCacheDriver() : Cache|null
- setCacheKey() : QueryCacheProfile
- setLifetime() : QueryCacheProfile
- setResultCacheDriver() : QueryCacheProfile
Properties
$cacheKey
private
string|null
$cacheKey
$lifetime
private
int
$lifetime
= 0
$resultCacheDriver
private
Cache|null
$resultCacheDriver
Methods
__construct()
public
__construct(int $lifetime[, string|null $cacheKey = null ][, Cache|null $resultCache = null ]) : mixed
Parameters
- $lifetime : int
- $cacheKey : string|null = null
- $resultCache : Cache|null = null
Return values
mixed —generateCacheKeys()
Generates the real cache key from query, params and types.
public
generateCacheKeys(string $query, array<string|int, mixed> $params, array<string|int, mixed> $types) : array<string|int, mixed>
Parameters
- $query : string
- $params : array<string|int, mixed>
- $types : array<string|int, mixed>
Return values
array<string|int, mixed> —getCacheKey()
public
getCacheKey() : string
Tags
Return values
string —getLifetime()
public
getLifetime() : int
Return values
int —getResultCacheDriver()
public
getResultCacheDriver() : Cache|null
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 —setResultCacheDriver()
public
setResultCacheDriver(Cache $cache) : QueryCacheProfile
Parameters
- $cache : Cache