category Zend
package Zend_Cache
subpackage Storage

 Methods

Add an item.

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

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

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) : bool

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

see \Zend\Cache\Storage\getItem()
see \Zend\Cache\Storage\setItem()

Parameters

$token

mixed

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

Decrement an item.

decrementItem(string $key, int $value) : int | bool

Parameters

$key

string

$value

int

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

intboolThe 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

Get an item.

getItem(string $key, bool $success, mixed $casToken) : mixed

Parameters

$key

string

$success

bool

$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

Test if an item exists.

hasItem(string $key) : bool

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

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, int $value) : int | bool

Parameters

$key

string

$value

int

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

intboolThe 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) : bool

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

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) : bool

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

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) : bool

Parameters

$key

string

$value

mixed

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

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

Reset lifetime of an item

touchItem(string $key) : bool

Parameters

$key

string

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

bool

Reset lifetime of multiple items.

touchItems(array $keys) : array

Parameters

$keys

array

Exceptions

\Zend\Cache\Exception\ExceptionInterface

Returns

arrayArray of not updated keys