interface KeyValueStoreExpirableInterface

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/KeyValueStore/KeyValueStoreExpirableInterface.php \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
  2. 8.9.x core/lib/Drupal/Core/KeyValueStore/KeyValueStoreExpirableInterface.php \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
  3. 10 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

7 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
ModulesListNonStableConfirmForm.php in core/modules/system/src/Form/ModulesListNonStableConfirmForm.php
ModulesUninstallConfirmForm.php in core/modules/system/src/Form/ModulesUninstallConfirmForm.php
ModulesUninstallForm.php in core/modules/system/src/Form/ModulesUninstallForm.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

Title Sort descending Modifiers Object type Summary Overrides
KeyValueStoreExpirableInterface::setMultipleWithExpire public function Saves an array of values with a time to live. 2
KeyValueStoreExpirableInterface::setWithExpire public function Saves a value for a given key with a time to live. 2
KeyValueStoreExpirableInterface::setWithExpireIfNotExists public function Sets a value for a given key with a time to live if it does not yet exist. 2
KeyValueStoreInterface::delete public function Deletes an item from the key/value store. 2
KeyValueStoreInterface::deleteAll public function Deletes all items from the key/value store. 3
KeyValueStoreInterface::deleteMultiple public function Deletes multiple items from the key/value store. 3
KeyValueStoreInterface::get public function Returns the stored value for a given key. 2
KeyValueStoreInterface::getAll public function Returns all stored key/value pairs in the collection. 3
KeyValueStoreInterface::getCollectionName public function Returns the name of this collection. 2
KeyValueStoreInterface::getMultiple public function Returns the stored key/value pairs for a given set of keys. 3
KeyValueStoreInterface::has public function Returns whether a given key exists in the store. 3
KeyValueStoreInterface::rename public function Renames a key. 3
KeyValueStoreInterface::set public function Saves a value for a given key. 3
KeyValueStoreInterface::setIfNotExists public function Saves a value for a given key if it does not exist yet. 3
KeyValueStoreInterface::setMultiple public function Saves key/value pairs. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.