Documentation

CRM_Utils_Cache_CacheWrapper
in package
implements CRM_Utils_Cache_Interface

Table of Contents

Interfaces

CRM_Utils_Cache_Interface

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

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.

Return values
bool

delete()

Delete a value from the cache.

public delete(mixed $key) : bool
Parameters
$key : mixed
Return values
bool

deleteMultiple()

public deleteMultiple(mixed $keys) : mixed
Parameters
$keys : mixed

flush()

Delete all values from the cache.

public flush() : bool
Return values
bool

get()

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|null

getMultiple()

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
bool

set()

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
bool

setMultiple()

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

        
On this page

Search results