package Default

 Methods

Add an item.

addItem(string $key, mixed $value) : boolean

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Add multiple items.

addItems(array $keyValuePairs) : array

Parameters

$keyValuePairs

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not stored keys

Set an item only if token matches

checkAndSetItem(mixed $token, string $key, mixed $value) : boolean

It uses the token received from getItem() to check if the item has changed before overwriting it.

see
see

Parameters

$token

mixed

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Decrement an item.

decrementItem(string $key, integer $value) : integer | boolean

Parameters

$key

string

$value

integer

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

integerbooleanThe new value on success, false on failure

Decrement multiple items.

decrementItems(array $keyValuePairs) : array

Parameters

$keyValuePairs

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayAssociative array of keys and new values

Capabilities of this storage

getCapabilities() : \Zend\Cache\Storage\Capabilities

Returns

\Zend\Cache\Storage\Capabilities

Get an item.

getItem(string $key, boolean $success = null, mixed $casToken = null) : mixed

Parameters

$key

string

$success

boolean

$casToken

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

mixedData on success, null on failure

Get multiple items.

getItems(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayAssociative array of keys and values

Get multiple metadata

getMetadatas(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayAssociative array of keys and metadata

Get options

getOptions() : \Zend\Cache\Storage\Adapter\AdapterOptions

Returns

\Zend\Cache\Storage\Adapter\AdapterOptions

Test if an item exists.

hasItem(string $key) : boolean

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Test multiple items.

hasItems(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of found keys

Increment an item.

incrementItem(string $key, integer $value) : integer | boolean

Parameters

$key

string

$value

integer

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

integerbooleanThe new value on success, false on failure

Increment multiple items.

incrementItems(array $keyValuePairs) : array

Parameters

$keyValuePairs

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayAssociative array of keys and new values

Remove an item.

removeItem(string $key) : boolean

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Remove multiple items.

removeItems(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not removed keys

Replace an existing item.

replaceItem(string $key, mixed $value) : boolean

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Replace multiple existing items.

replaceItems(array $keyValuePairs) : array

Parameters

$keyValuePairs

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not stored keys

Store an item.

setItem(string $key, mixed $value) : boolean

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Store multiple items.

setItems(array $keyValuePairs) : array

Parameters

$keyValuePairs

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not stored keys

Set options.

setOptions(array|\Traversable|\Zend\Cache\Storage\Adapter\AdapterOptions $options) : \Zend\Cache\Storage\StorageInterface

Parameters

$options

array\Traversable\Zend\Cache\Storage\Adapter\AdapterOptions

Returns

\Zend\Cache\Storage\StorageInterfaceFluent interface

Reset lifetime of an item

touchItem(string $key) : boolean

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

boolean

Reset lifetime of multiple items.

touchItems(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not updated keys