interface CRM_Utils_Cache_Interface implements CacheInterface

Methods

bool
set(string $key, mixed $value, null|int|DateInterval $ttl = NULL)

Set the value in the cache.

mixed
get(string $key, mixed $default = NULL)

Get a value from the cache.

bool
delete(string $key)

Delete a value from the cache.

bool
flush() deprecated

Delete all values from the cache.

bool
clear()

Delete all values from the cache.

bool
has(string $key)

Determines whether an item is present in the cache.

Details

at line 50
bool set(string $key, mixed $value, null|int|DateInterval $ttl = NULL)

Set the value in the cache.

Parameters

string $key
mixed $value
null|int|DateInterval $ttl

Return Value

bool

at line 60
mixed get(string $key, mixed $default = NULL)

Get a value from the cache.

Parameters

string $key
mixed $default

Return Value

mixed The previously set value value, or $default (NULL).

at line 68
bool delete(string $key)

Delete a value from the cache.

Parameters

string $key

Return Value

bool

at line 80
bool flush() deprecated

deprecated

Delete all values from the cache.

NOTE: flush() and clear() should be aliases. flush() is specified by Civi's traditional interface, and clear() is specified by PSR-16.

Return Value

bool

See also

clear

at line 91
bool clear()

Delete all values from the cache.

NOTE: flush() and clear() should be aliases. flush() is specified by Civi's traditional interface, and clear() is specified by PSR-16.

Return Value

bool

See also

flush

at line 105
bool has(string $key)

Determines whether an item is present in the cache.

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

string $key The cache item key.

Return Value

bool