CRM_Utils_Cache_CacheWrapper
in package
implements
CRM_Utils_Cache_Interface
Table of Contents
Interfaces
Properties
- $delegate : CRM_Utils_Cache_Interface
- $serviceName : string
Methods
- __construct() : mixed
- clear() : bool
- Delete all values from the cache.
- delete() : bool
- Delete a value from the cache.
- deleteMultiple() : mixed
- flush() : bool
- Delete all values from the cache.
- get() : mixed
- Get a value from the cache.
- getExpires() : int|null
- getMultiple() : mixed
- has() : bool
- Determines whether an item is present in the cache.
- set() : bool
- Set the value in the cache.
- setMultiple() : mixed
- dispatchClearEvent() : mixed
Properties
$delegate
private
CRM_Utils_Cache_Interface
$delegate
$serviceName
private
string
$serviceName
Methods
__construct()
public
__construct(CRM_Utils_Cache_Interface $delegate, string $serviceName) : mixed
Parameters
- $delegate : CRM_Utils_Cache_Interface
- $serviceName : string
clear()
Delete all values from the cache.
public
clear() : bool
NOTE: flush() and clear() should be aliases. flush() is specified by Civi's traditional interface, and clear() is specified by PSR-16.
Return values
booldelete()
Delete a value from the cache.
public
delete(mixed $key) : bool
Parameters
- $key : mixed
Return values
booldeleteMultiple()
public
deleteMultiple(mixed $keys) : mixed
Parameters
- $keys : mixed
flush()
Delete all values from the cache.
public
flush() : bool
Return values
boolget()
Get a value from the cache.
public
get(mixed $key[, mixed $default = NULL ]) : mixed
Parameters
- $key : mixed
- $default : mixed = NULL
Return values
mixed —The previously set value value, or $default (NULL).
getExpires()
public
getExpires(string $key) : int|null
Parameters
- $key : string
Return values
int|nullgetMultiple()
public
getMultiple(mixed $keys[, mixed $default = NULL ]) : mixed
Parameters
- $keys : mixed
- $default : mixed = NULL
has()
Determines whether an item is present in the cache.
public
has(mixed $key) : bool
NOTE: It is recommended that has() is only to be used for cache warming type purposes and not to be used within your live applications operations for get/set, as this method is subject to a race condition where your has() will return true and immediately after, another script can remove it making the state of your app out of date.
Parameters
- $key : mixed
-
The cache item key.
Return values
boolset()
Set the value in the cache.
public
set(mixed $key, mixed $value[, mixed $ttl = NULL ]) : bool
Parameters
- $key : mixed
- $value : mixed
- $ttl : mixed = NULL
Return values
boolsetMultiple()
public
setMultiple(mixed $values[, mixed $ttl = NULL ]) : mixed
Parameters
- $values : mixed
- $ttl : mixed = NULL
dispatchClearEvent()
private
dispatchClearEvent([mixed $keys = NULL ]) : mixed
Parameters
- $keys : mixed = NULL