KeyValueStoreExpirableInterface
interface KeyValueStoreExpirableInterface implements KeyValueStoreInterface (View source)
Defines the interface for expiring data in a key/value store.
Methods
Returns the stored value for a given key.
Returns the stored key/value pairs for a given set of keys.
Saves a value for a given key if it does not exist yet.
Deletes multiple items from the key/value store.
Saves a value for a given key with a time to live.
Sets a value for a given key with a time to live if it does not yet exist.
Saves an array of values with a time to live.
Details
string
getCollectionName()
Returns the name of this collection.
bool
has(string $key)
Returns whether a given key exists in the store.
mixed
get(string $key, mixed $default = NULL)
Returns the stored value for a given key.
array
getMultiple(array $keys)
Returns the stored key/value pairs for a given set of keys.
array
getAll()
Returns all stored key/value pairs in the collection.
set(string $key, mixed $value)
Saves a value for a given key.
bool
setIfNotExists(string $key, mixed $value)
Saves a value for a given key if it does not exist yet.
setMultiple(array $data)
Saves key/value pairs.
rename(string $key, string $new_key)
Renames a key.
delete(string $key)
Deletes an item from the key/value store.
deleteMultiple(array $keys)
Deletes multiple items from the key/value store.
deleteAll()
Deletes all items from the key/value store.
setWithExpire(string $key, mixed $value, int $expire)
Saves a value for a given key with a time to live.
bool
setWithExpireIfNotExists(string $key, mixed $value, int $expire)
Sets a value for a given key with a time to live if it does not yet exist.
If a key is expired it also does not exists.
setMultipleWithExpire(array $data, int $expire)
Saves an array of values with a time to live.