Fully Qualified Name: | Laminas\Cache\Storage\Adapter\Dba |
Extends: | AbstractAdapter |
Implements: | AvailableSpaceCapableInterface, ClearByNamespaceInterface, ClearByPrefixInterface, FlushableInterface, IterableInterface, OptimizableInterface, TotalSpaceCapableInterface |
Name | Description | Defined By |
---|---|---|
__construct() | Constructor | Dba |
__destruct() | Destructor | Dba |
addItem() | Add an item. | AbstractAdapter |
addItems() | Add multiple items. | AbstractAdapter |
addPlugin() | Register a plugin | AbstractAdapter |
checkAndSetItem() | Set an item only if token matches | AbstractAdapter |
clearByNamespace() | Remove items by given namespace | Dba |
clearByPrefix() | Remove items matching given prefix | Dba |
decrementItem() | Decrement an item. | AbstractAdapter |
decrementItems() | Decrement multiple items. | AbstractAdapter |
flush() | Flush the whole storage | Dba |
getAvailableSpace() | Get available space in bytes | Dba |
getCaching() | Get caching enabled. | AbstractAdapter |
getCapabilities() | Get capabilities of this adapter | AbstractAdapter |
getEventManager() | Get the event manager | AbstractAdapter |
getItem() | Get an item. | AbstractAdapter |
getItems() | Get multiple items. | AbstractAdapter |
getIterator() | Get the storage iterator | Dba |
getMetadata() | Get metadata of an item. | AbstractAdapter |
getMetadatas() | Get multiple metadata | AbstractAdapter |
getOptions() | Get options. | Dba |
getPluginRegistry() | Return registry of plugins | AbstractAdapter |
getTotalSpace() | Get total space in bytes | Dba |
hasItem() | Test if an item exists. | AbstractAdapter |
hasItems() | Test multiple items. | AbstractAdapter |
hasPlugin() | Check if a plugin is registered | AbstractAdapter |
incrementItem() | Increment an item. | AbstractAdapter |
incrementItems() | Increment multiple items. | AbstractAdapter |
optimize() | Optimize the storage | Dba |
removeItem() | Remove an item. | AbstractAdapter |
removeItems() | Remove multiple items. | AbstractAdapter |
removePlugin() | Unregister an already registered plugin | AbstractAdapter |
replaceItem() | Replace an existing item. | AbstractAdapter |
replaceItems() | Replace multiple existing items. | AbstractAdapter |
setCaching() | Enable/Disable caching. | AbstractAdapter |
setItem() | Store an item. | AbstractAdapter |
setItems() | Store multiple items. | AbstractAdapter |
setOptions() | Set options. | Dba |
touchItem() | Reset lifetime of an item | AbstractAdapter |
touchItems() | Reset lifetime of multiple items. | AbstractAdapter |
Constructor
Parameter Name | Type | Description |
---|---|---|
$options | null|array|\Traversable|\DbaOptions |
Returns:
Destructor
Closes an open dba resource
Returns: void
Add an item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: bool
Add multiple items.
Parameter Name | Type | Description |
---|---|---|
$keyValuePairs | array |
Returns: array Array of not stored keys
Register a plugin
Parameter Name | Type | Description |
---|---|---|
$plugin | \Plugin\PluginInterface | |
$priority | int |
Returns: \AbstractAdapter Provides a fluent interface
Set an item only if token matches
It uses the token received from getItem() to check if the item has changed before overwriting it.
Parameter Name | Type | Description |
---|---|---|
$token | mixed | |
$key | string | |
$value | mixed |
Returns: bool
Remove items by given namespace
Parameter Name | Type | Description |
---|---|---|
$namespace | string |
Returns: bool
Remove items matching given prefix
Parameter Name | Type | Description |
---|---|---|
$prefix | string |
Returns: bool
Decrement an item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | int |
Returns: int|bool The new value on success, false on failure
Decrement multiple items.
Parameter Name | Type | Description |
---|---|---|
$keyValuePairs | array |
Returns: array Associative array of keys and new values
Flush the whole storage
Returns: bool
Get available space in bytes
Returns: float
Get caching enabled.
Alias of getWritable and getReadable.
Returns: bool
Get capabilities of this adapter
Returns: \Capabilities
Get the event manager
Returns: \EventManagerInterface
Get an item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$success | bool | |
$casToken | mixed |
Returns: mixed Data on success, null on failure
Get multiple items.
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: array Associative array of keys and values
Get the storage iterator
Returns: \DbaIterator
Get metadata of an item.
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: array|bool Metadata on success, false on failure
Get multiple metadata
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: array Associative array of keys and metadata
Get options.
Returns: \DbaOptions
Return registry of plugins
Returns: \SplObjectStorage
Get total space in bytes
Returns: int|float
Test if an item exists.
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Test multiple items.
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: array Array of found keys
Check if a plugin is registered
Parameter Name | Type | Description |
---|---|---|
$plugin | \Plugin\PluginInterface |
Returns: bool
Increment an item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | int |
Returns: int|bool The new value on success, false on failure
Increment multiple items.
Parameter Name | Type | Description |
---|---|---|
$keyValuePairs | array |
Returns: array Associative array of keys and new values
Optimize the storage
Returns: bool
Remove an item.
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Remove multiple items.
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: array Array of not removed keys
Unregister an already registered plugin
Parameter Name | Type | Description |
---|---|---|
$plugin | \Plugin\PluginInterface |
Returns: \AbstractAdapter Provides a fluent interface
Replace an existing item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: bool
Replace multiple existing items.
Parameter Name | Type | Description |
---|---|---|
$keyValuePairs | array |
Returns: array Array of not stored keys
Enable/Disable caching.
Alias of setWritable and setReadable.
Parameter Name | Type | Description |
---|---|---|
$flag | bool |
Returns: \AbstractAdapter Provides a fluent interface
Store an item.
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: bool
Store multiple items.
Parameter Name | Type | Description |
---|---|---|
$keyValuePairs | array |
Returns: array Array of not stored keys
Set options.
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable|\DbaOptions |
Returns: self
Reset lifetime of an item
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Reset lifetime of multiple items.
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: array Array of not updated keys