\apex\app\interfacesCacheInterface

Cache Interface

Summary

Methods
Constants
get()
has()
set()
delete()
clear()
mset()
mdelete()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

get()

get(string  $key, mixed  $default_value = false) : mixed

Get cache item.

Parameters

string $key

The key of the cache item.

mixed $default_value

Optional default value to return, if no cache exists. Defaults to false.

Returns

mixed —

Value of the cache item, or default value if not exists.

has()

has(string  $key) : boolean

CHeck if cache item exists

Parameters

string $key

Key of chache item to check

Returns

boolean —

Whether or not cache item exists

set()

set(string  $key, mixed  $value, integer  $ttl) 

Set cache item

Parameters

string $key

Key of the cache item

mixed $value

The value of the item.

integer $ttl

The TTL of the cache item.

delete()

delete(string  $key) 

Delete cache item

Parameters

string $key

Item to delte

clear()

clear() 

Clear the cache.

mset()

mset(array  $items, integer  $ttl) : array

Get multiple cache items.

Parameters

array $items

The items to key.

integer $ttl

The TTL in secions of all items.

Returns

array —

The values of all found keys.

public function gets(...$keys);

Set multiple cache items.

mdelete()

mdelete(\apex\app\interfaces\iterable  $keys) 

Delete multiple cache items.

Parameters

\apex\app\interfaces\iterable $keys

The item keys to delete.