CRM_Utils_Cache_Interface
extends
CacheInterface
in
Tags
Table of Contents
Methods
- clear() : bool
- Delete all values from the cache.
- delete() : bool
- Delete a value from the cache.
- flush() : bool
- Delete all values from the cache.
- get() : mixed
- Get a value from the cache.
- has() : bool
- Determines whether an item is present in the cache.
- set() : bool
- Set the value in the cache.
Methods
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.
Tags
Return values
booldelete()
Delete a value from the cache.
public
delete(string $key) : bool
Parameters
- $key : string
Return values
boolflush()
Delete all values from the cache.
public
flush() : bool
NOTE: flush() and clear() should be aliases. flush() is specified by Civi's traditional interface, and clear() is specified by PSR-16.
Tags
Return values
boolget()
Get a value from the cache.
public
get(string $key[, mixed $default = NULL ]) : mixed
Parameters
- $key : string
- $default : mixed = NULL
Return values
mixed —The previously set value value, or $default (NULL).
has()
Determines whether an item is present in the cache.
public
has(string $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 : string
-
The cache item key.
Return values
boolset()
Set the value in the cache.
public
set(string $key, mixed $value[, null|int|DateInterval $ttl = NULL ]) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : null|int|DateInterval = NULL