You are here

interface KeyValueStoreExpirableInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/KeyValueStore/KeyValueStoreExpirableInterface.php \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
  2. 9 core/lib/Drupal/Core/KeyValueStore/KeyValueStoreExpirableInterface.php \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface

Defines the interface for expiring data in a key/value store.

Hierarchy

Expanded class hierarchy of KeyValueStoreExpirableInterface

All classes that implement KeyValueStoreExpirableInterface

6 files declare their use of KeyValueStoreExpirableInterface
ModulesListConfirmForm.php in core/modules/system/src/Form/ModulesListConfirmForm.php
ModulesListForm.php in core/modules/system/src/Form/ModulesListForm.php
ModulesUninstallConfirmForm.php in core/modules/system/src/Form/ModulesUninstallConfirmForm.php
ModulesUninstallForm.php in core/modules/system/src/Form/ModulesUninstallForm.php
PrivateTempStore.php in core/lib/Drupal/Core/TempStore/PrivateTempStore.php

... See full list

File

core/lib/Drupal/Core/KeyValueStore/KeyValueStoreExpirableInterface.php, line 8

Namespace

Drupal\Core\KeyValueStore
View source
interface KeyValueStoreExpirableInterface extends KeyValueStoreInterface {

  /**
   * Saves a value for a given key with a time to live.
   *
   * @param string $key
   *   The key of the data to store.
   * @param mixed $value
   *   The data to store.
   * @param int $expire
   *   The time to live for items, in seconds.
   */
  public function setWithExpire($key, $value, $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.
   *
   * @param string $key
   *   The key of the data to store.
   * @param mixed $value
   *   The data to store.
   * @param int $expire
   *   The time to live for items, in seconds.
   *
   * @return bool
   *   TRUE if the data was set, or FALSE if it already existed.
   */
  public function setWithExpireIfNotExists($key, $value, $expire);

  /**
   * Saves an array of values with a time to live.
   *
   * @param array $data
   *   An array of data to store.
   * @param int $expire
   *   The time to live for items, in seconds.
   */
  public function setMultipleWithExpire(array $data, $expire);

}

Members