class ZendMemory extends Store

Zend memory store.

Properties

protected string|null $prefix Prefix. from Store

Methods

$this
setPrefix(string $prefix)

Sets the cache key prefix.

from Store
string|null
getPrefix()

Returns the cache key prefix.

from Store
string
getPrefixedKey(string $key)

Returns a prefixed key.

from Store
bool
putIfNotExists(string $key, mixed $data, int $ttl = 0)

Store data in the cache if it doesn't already exist.

from Store
mixed
getAndPut(string $key, mixed $data, int $ttl = 0)

Fetch data from the cache and replace it.

from Store
mixed
getAndRemove(string $key)

Fetch data from the cache and remove it.

from Store
mixed
getOrElse(string $key, callable $data, int $ttl = 0)

Fetch data from the cache or store it if it doesn't already exist.

from Store
__construct()

Constructor.

bool
put(string $key, mixed $data, int $ttl = 0)

Store data in the cache.

bool
has(string $key)

Returns TRUE if the cache key exists and FALSE if not.

mixed
get(string $key)

Fetch data from the cache.

bool
remove(string $key)

Delete data from the cache.

bool
clear()

Clears the cache.

Details

in Store at line 30
$this setPrefix(string $prefix)

Sets the cache key prefix.

Parameters

string $prefix Prefix

Return Value

$this

in Store at line 42
string|null getPrefix()

Returns the cache key prefix.

Return Value

string|null

in Store at line 53
protected string getPrefixedKey(string $key)

Returns a prefixed key.

Parameters

string $key Key

Return Value

string

in Store at line 61
bool putIfNotExists(string $key, mixed $data, int $ttl = 0)

Store data in the cache if it doesn't already exist.

Parameters

string $key Cache key
mixed $data The data to store
int $ttl Time to live

Return Value

bool

in Store at line 79
mixed getAndPut(string $key, mixed $data, int $ttl = 0)

Fetch data from the cache and replace it.

Parameters

string $key Cache key
mixed $data The data to store
int $ttl Time to live

Return Value

mixed

in Store at line 94
mixed getAndRemove(string $key)

Fetch data from the cache and remove it.

Parameters

string $key Cache key

Return Value

mixed

in Store at line 109
mixed getOrElse(string $key, callable $data, int $ttl = 0)

Fetch data from the cache or store it if it doesn't already exist.

Parameters

string $key Cache key
callable $data
int $ttl Time to live

Return Value

mixed

at line 30
__construct()

Constructor.

Exceptions

RuntimeException

at line 41
bool put(string $key, mixed $data, int $ttl = 0)

Store data in the cache.

Parameters

string $key Cache key
mixed $data The data to store
int $ttl Time to live

Return Value

bool

at line 49
bool has(string $key)

Returns TRUE if the cache key exists and FALSE if not.

Parameters

string $key Cache key

Return Value

bool

at line 57
mixed get(string $key)

Fetch data from the cache.

Parameters

string $key Cache key

Return Value

mixed

at line 65
bool remove(string $key)

Delete data from the cache.

Parameters

string $key Cache key

Return Value

bool

at line 73
bool clear()

Clears the cache.

Return Value

bool