Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / KeyValueStore / KeyValueStoreExpirableInterface.php
1 <?php
2
3 namespace Drupal\Core\KeyValueStore;
4
5 /**
6  * Defines the interface for expiring data in a key/value store.
7  */
8 interface KeyValueStoreExpirableInterface extends KeyValueStoreInterface {
9
10   /**
11    * Saves a value for a given key with a time to live.
12    *
13    * @param string $key
14    *   The key of the data to store.
15    * @param mixed $value
16    *   The data to store.
17    * @param int $expire
18    *   The time to live for items, in seconds.
19    */
20   public function setWithExpire($key, $value, $expire);
21
22   /**
23    * Sets a value for a given key with a time to live if it does not yet exist.
24    *
25    * @param string $key
26    *   The key of the data to store.
27    * @param mixed $value
28    *   The data to store.
29    * @param int $expire
30    *   The time to live for items, in seconds.
31    *
32    * @return bool
33    *   TRUE if the data was set, or FALSE if it already existed.
34    */
35   public function setWithExpireIfNotExists($key, $value, $expire);
36
37   /**
38    * Saves an array of values with a time to live.
39    *
40    * @param array $data
41    *   An array of data to store.
42    * @param int $expire
43    *   The time to live for items, in seconds.
44    */
45   public function setMultipleWithExpire(array $data, $expire);
46
47 }