3 namespace Drupal\Core\KeyValueStore;
6 * Defines the interface for expiring data in a key/value store.
8 interface KeyValueStoreExpirableInterface extends KeyValueStoreInterface {
11 * Saves a value for a given key with a time to live.
14 * The key of the data to store.
18 * The time to live for items, in seconds.
20 public function setWithExpire($key, $value, $expire);
23 * Sets a value for a given key with a time to live if it does not yet exist.
26 * The key of the data to store.
30 * The time to live for items, in seconds.
33 * TRUE if the data was set, or FALSE if it already existed.
35 public function setWithExpireIfNotExists($key, $value, $expire);
38 * Saves an array of values with a time to live.
41 * An array of data to store.
43 * The time to live for items, in seconds.
45 public function setMultipleWithExpire(array $data, $expire);