Methods
Destructor
__destruct() : void
detach all registered plugins to free
event handles of event manager
Add an item.
addItem(string $key, mixed $value) : bool
triggers |
addItem.pre(PreEvent) |
triggers |
addItem.post(PostEvent) |
triggers |
addItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Add multiple items.
addItems(array $keyValuePairs) : array
triggers |
addItems.pre(PreEvent) |
triggers |
addItems.post(PostEvent) |
triggers |
addItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array 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\Adapter\getItem() |
see |
\Zend\Cache\Storage\Adapter\setItem() |
Parameters
$token
mixed
$key
string
$value
mixed
Exceptions
Returns
bool
Decrement an item.
decrementItem(string $key, int $value) : int | bool
triggers |
decrementItem.pre(PreEvent) |
triggers |
decrementItem.post(PostEvent) |
triggers |
decrementItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Decrement multiple items.
decrementItems(array $keyValuePairs) : array
triggers |
incrementItems.pre(PreEvent) |
triggers |
incrementItems.post(PostEvent) |
triggers |
incrementItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Get caching enabled.
getCaching() : bool
Alias of getWritable and getReadable.
see |
\Zend\Cache\Storage\Adapter\getWritable() |
see |
\Zend\Cache\Storage\Adapter\getReadable() |
Returns
bool
Get capabilities of this adapter
getCapabilities() : \Zend\Cache\Storage\Capabilities
triggers |
getCapabilities.pre(PreEvent) |
triggers |
getCapabilities.post(PostEvent) |
triggers |
getCapabilities.exception(ExceptionEvent) |
Returns
Get an item.
getItem(string $key, bool $success, mixed $casToken) : mixed
triggers |
getItem.pre(PreEvent) |
triggers |
getItem.post(PostEvent) |
triggers |
getItem.exception(ExceptionEvent) |
Parameters
$key
string
$success
bool
$casToken
mixed
Exceptions
Returns
mixed
Data on success, null on failure
Get multiple items.
getItems(array $keys) : array
triggers |
getItems.pre(PreEvent) |
triggers |
getItems.post(PostEvent) |
triggers |
getItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Associative array of keys and values
Test if an item exists.
hasItem(string $key) : bool
triggers |
hasItem.pre(PreEvent) |
triggers |
hasItem.post(PostEvent) |
triggers |
hasItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Test multiple items.
hasItems(array $keys) : array
triggers |
hasItems.pre(PreEvent) |
triggers |
hasItems.post(PostEvent) |
triggers |
hasItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of found keys
Check if a plugin is registered
hasPlugin(\Zend\Cache\Storage\Plugin\PluginInterface $plugin) : bool
Increment an item.
incrementItem(string $key, int $value) : int | bool
triggers |
incrementItem.pre(PreEvent) |
triggers |
incrementItem.post(PostEvent) |
triggers |
incrementItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Increment multiple items.
incrementItems(array $keyValuePairs) : array
triggers |
incrementItems.pre(PreEvent) |
triggers |
incrementItems.post(PostEvent) |
triggers |
incrementItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Remove an item.
removeItem(string $key) : bool
triggers |
removeItem.pre(PreEvent) |
triggers |
removeItem.post(PostEvent) |
triggers |
removeItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Remove multiple items.
removeItems(array $keys) : array
triggers |
removeItems.pre(PreEvent) |
triggers |
removeItems.post(PostEvent) |
triggers |
removeItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of not removed keys
Replace an existing item.
replaceItem(string $key, mixed $value) : bool
triggers |
replaceItem.pre(PreEvent) |
triggers |
replaceItem.post(PostEvent) |
triggers |
replaceItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Replace multiple existing items.
replaceItems(array $keyValuePairs) : array
triggers |
replaceItems.pre(PreEvent) |
triggers |
replaceItems.post(PostEvent) |
triggers |
replaceItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Enable/Disable caching.
setCaching(bool $flag) : \Zend\Cache\Storage\Adapter\AbstractAdapter
Alias of setWritable and setReadable.
see |
\Zend\Cache\Storage\Adapter\setWritable() |
see |
\Zend\Cache\Storage\Adapter\setReadable() |
Parameters
$flag
bool
Returns
Store an item.
setItem(string $key, mixed $value) : bool
triggers |
setItem.pre(PreEvent) |
triggers |
setItem.post(PostEvent) |
triggers |
setItem.exception(ExceptionEvent) |
Parameters
$key
string
$value
mixed
Exceptions
Returns
bool
Store multiple items.
setItems(array $keyValuePairs) : array
triggers |
setItems.pre(PreEvent) |
triggers |
setItems.post(PostEvent) |
triggers |
setItems.exception(ExceptionEvent) |
Parameters
$keyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Reset lifetime of an item
touchItem(string $key) : bool
triggers |
touchItem.pre(PreEvent) |
triggers |
touchItem.post(PostEvent) |
triggers |
touchItem.exception(ExceptionEvent) |
Parameters
$key
string
Exceptions
Returns
bool
Reset lifetime of multiple items.
touchItems(array $keys) : array
triggers |
touchItems.pre(PreEvent) |
triggers |
touchItems.post(PostEvent) |
triggers |
touchItems.exception(ExceptionEvent) |
Parameters
$keys
array
Exceptions
Returns
array
Array of not updated keys
Internal method to add an item.
internalAddItem(string $normalizedKey, mixed $value) : bool
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to add multiple items.
internalAddItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to set an item only if token matches
internalCheckAndSetItem(mixed $token, string $normalizedKey, mixed $value) : bool
see |
\Zend\Cache\Storage\Adapter\getItem() |
see |
\Zend\Cache\Storage\Adapter\setItem() |
Parameters
$token
mixed
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to decrement an item.
internalDecrementItem(string $normalizedKey, int $value) : int | bool
Parameters
$normalizedKey
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Internal method to decrement multiple items.
internalDecrementItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Internal method to get an item.
internalGetItem(string $normalizedKey, bool $success, mixed $casToken) : mixed
Parameters
$normalizedKey
string
$success
bool
$casToken
mixed
Exceptions
Returns
mixed
Data on success, null on failure
Internal method to get multiple items.
internalGetItems(array $normalizedKeys) : array
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Associative array of keys and values
Internal method to test if an item exists.
internalHasItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to test multiple items.
internalHasItems(array $normalizedKeys) : array
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of found keys
Internal method to increment an item.
internalIncrementItem(string $normalizedKey, int $value) : int | bool
Parameters
$normalizedKey
string
$value
int
Exceptions
Returns
int
bool
The new value on success, false on failure
Internal method to increment multiple items.
internalIncrementItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Associative array of keys and new values
Internal method to remove an item.
internalRemoveItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to remove multiple items.
internalRemoveItems(array $normalizedKeys) : array
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of not removed keys
Internal method to replace an existing item.
internalReplaceItem(string $normalizedKey, mixed $value) : bool
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to replace multiple existing items.
internalReplaceItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to store an item.
internalSetItem(string $normalizedKey, mixed $value) : bool
Parameters
$normalizedKey
string
$value
mixed
Exceptions
Returns
bool
Internal method to store multiple items.
internalSetItems(array $normalizedKeyValuePairs) : array
Parameters
$normalizedKeyValuePairs
array
Exceptions
Returns
array
Array of not stored keys
Internal method to reset lifetime of an item
internalTouchItem(string $normalizedKey) : bool
Parameters
$normalizedKey
string
Exceptions
Returns
bool
Internal method to reset lifetime of multiple items.
internalTouchItems(array $normalizedKeys) : array
Parameters
$normalizedKeys
array
Exceptions
Returns
array
Array of not updated keys
Validates and normalizes a key
normalizeKey(string $key) : void
Parameters
$key
string
Exceptions
Validates and normalizes an array of key-value pairs
normalizeKeyValuePairs(array $keyValuePairs) : void
Parameters
$keyValuePairs
array
Exceptions
Validates and normalizes multiple keys
normalizeKeys(array $keys) : void
Parameters
$keys
array
Exceptions
Trigger an exception event
triggerException(string $eventName, \ArrayObject $args, mixed $result, \Exception $exception) : mixed
If the ExceptionEvent has the flag "throwException" enabled throw the
exception after trigger else return the result.
Parameters
$eventName
string
$result
mixed
Exceptions
Returns
mixed
Triggers the PostEvent and return the result value.
triggerPost(string $eventName, \ArrayObject $args, mixed $result) : mixed
Parameters
$eventName
string
$result
mixed
Returns
mixed
Trigger a pre event and return the event response collection
triggerPre(string $eventName, \ArrayObject $args) : \Zend\EventManager\ResponseCollection
Parameters
$eventName
string
Returns
Properties
Marker to change capabilities
$capabilityMarker : null | object
Event handles of this adapter
$eventHandles : array