Methods summary
abstract protected
mixed
|
#
clientNotFoundValue( )
Return the value corresponding to "not found"
for the internal client.
Return the value corresponding to "not found"
for the internal client.
Returns
mixed
|
abstract protected
mixed
|
#
clientGet( string $key )
Call the internal client method to fetch a key.
Don't have to catch the exceptions.
Call the internal client method to fetch a key.
Don't have to catch the exceptions.
Parameters
Returns
mixed The raw value
|
abstract protected
array
|
#
clientGetMultiple( array $keys )
Call the internal client method to fetch multiple keys.
Don't have to catch the exceptions.
Call the internal client method to fetch multiple keys.
Don't have to catch the exceptions.
Parameters
Returns
array The raw values
|
abstract protected
|
#
clientSet( string $key, mixed $value )
Call the internal client method to set a value associated to a key.
Don't have to catch the exceptions.
Call the internal client method to set a value associated to a key.
Don't have to catch the exceptions.
Parameters
|
abstract protected
boolean
|
#
clientRemove( string $key )
Call the internal client method to remove a key.
Don't have to catch the exceptions.
Call the internal client method to remove a key.
Don't have to catch the exceptions.
Parameters
Returns
boolean true if the removal worked, false otherwise
|
abstract protected
boolean
|
#
clientExists( string $key )
Call the internal client method to check if a key exists.
Don't have to catch the exceptions.
Call the internal client method to check if a key exists.
Don't have to catch the exceptions.
Parameters
Returns
boolean
|
abstract protected
|
#
clientClear( )
Call the internal client method to clear all the keys.
Don't have to catch the exceptions.
Call the internal client method to clear all the keys.
Don't have to catch the exceptions.
|
abstract protected
array
|
#
clientKeys( )
Call the internal client method to fetch all the keys.
Don't have to catch the exceptions.
Call the internal client method to fetch all the keys.
Don't have to catch the exceptions.
Returns
array The keys
|
public
array
|
#
getMultiple( array $keys, mixed $default = null )
Returns the values of multiple keys in the store.
Returns the values of multiple keys in the store.
Parameters
- $keys
- The keys to get. The keys must be strings or integers.
- $default
The default value to return for keys that are not
found.
Returns
array The values of the passed keys, indexed by the keys.
Throws
Implementation of
|
public
array
|
#
getMultipleOrFail( array $keys )
Returns the values of multiple keys in the store.
Returns the values of multiple keys in the store.
Parameters
- $keys
- The keys to get. The keys must be strings or integers.
Returns
array The values of the passed keys, indexed by the keys.
Throws
Implementation of
|
public
mixed
|
#
get( integer|string $key, mixed $default = null )
Returns the value of a key in the store.
Returns the value of a key in the store.
Parameters
- $key
- The key to get.
- $default
The default value to return if the key does
not exist.
Returns
mixed The value of the key or the default value if the key does
not exist.
Throws
Implementation of
|
public
mixed
|
#
getOrFail( integer|string $key )
Returns the value of a key in the store.
Returns the value of a key in the store.
Parameters
Returns
mixed The value of the key.
Throws
Implementation of
|
public
|
#
set( integer|string $key, mixed $value )
Sets the value for a key in the store.
Sets the value for a key in the store.
Parameters
- $key
- The key to set.
- $value
- The value to set for the key.
Throws
Webmozart\KeyValueStore\Api\WriteException If the store cannot be written.
InvalidKeyException If the key is not a string or integer.
SerializationFailedException If the value cannot be serialized.
UnsupportedValueException If the value is not supported by the
implementation.
Implementation of
|
public
boolean
|
#
remove( integer|string $key )
Removes a key from the store.
Removes a key from the store.
Parameters
Returns
boolean Returns true if a key was removed from the store.
Throws
Implementation of
|
public
boolean
|
#
exists( integer|string $key )
Returns whether a key exists.
Returns whether a key exists.
Parameters
Returns
boolean Whether the key exists in the store.
Throws
Implementation of
|
public
|
#
clear( )
Removes all keys from the store.
Removes all keys from the store.
Throws
Implementation of
|
public
array
|
#
keys( )
Returns all keys currently stored in the store.
Returns all keys currently stored in the store.
Returns
array The keys stored in the store. Each key is either a string
or an integer. The order of the keys is undefined.
Throws
Implementation of
|