You are here

class NullStorageExpirable in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php \Drupal\Core\KeyValueStore\NullStorageExpirable

Defines a null key/value store implementation.

Hierarchy

Expanded class hierarchy of NullStorageExpirable

File

lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php, line 13
Contains \Drupal\Core\KeyValueStore\NullStorageExpirable.

Namespace

Drupal\Core\KeyValueStore
View source
class NullStorageExpirable implements KeyValueStoreExpirableInterface {

  /**
   * The actual storage of key-value pairs.
   *
   * @var array
   */
  protected $data = array();

  /**
   * The name of the collection holding key and value pairs.
   *
   * @var string
   */
  protected $collection;

  /**
   * Creates a new expirable null key/value store.
   */
  public function __construct($collection) {
    $this->collection = $collection;
  }

  /**
   * {@inheritdoc}
   */
  public function has($key) {
    return FALSE;
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::get().
   */
  public function get($key, $default = NULL) {
    return NULL;
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getMultiple().
   */
  public function getMultiple(array $keys) {
    return array();
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getAll().
   */
  public function getAll() {
    return array();
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::set().
   */
  public function set($key, $value) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::setIfNotExists().
   */
  public function setIfNotExists($key, $value) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::setMultiple().
   */
  public function setMultiple(array $data) {
  }

  /**
   * {@inheritdoc}
   */
  public function rename($key, $new_key) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::delete().
   */
  public function delete($key) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::deleteMultiple().
   */
  public function deleteMultiple(array $keys) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::deleteAll().
   */
  public function deleteAll() {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getCollectionName().
   */
  public function getCollectionName() {
    return $this->collection;
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setMultipleWithExpire().
   */
  public function setMultipleWithExpire(array $data, $expire) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setWithExpire().
   */
  public function setWithExpire($key, $value, $expire) {
  }

  /**
   * Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setWithExpireIfNotExists().
   */
  public function setWithExpireIfNotExists($key, $value, $expire) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NullStorageExpirable::$collection protected property The name of the collection holding key and value pairs.
NullStorageExpirable::$data protected property The actual storage of key-value pairs.
NullStorageExpirable::delete public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::delete(). Overrides KeyValueStoreInterface::delete
NullStorageExpirable::deleteAll public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::deleteAll(). Overrides KeyValueStoreInterface::deleteAll
NullStorageExpirable::deleteMultiple public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::deleteMultiple(). Overrides KeyValueStoreInterface::deleteMultiple
NullStorageExpirable::get public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::get(). Overrides KeyValueStoreInterface::get
NullStorageExpirable::getAll public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getAll(). Overrides KeyValueStoreInterface::getAll
NullStorageExpirable::getCollectionName public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getCollectionName(). Overrides KeyValueStoreInterface::getCollectionName
NullStorageExpirable::getMultiple public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getMultiple(). Overrides KeyValueStoreInterface::getMultiple
NullStorageExpirable::has public function Returns whether a given key exists in the store. Overrides KeyValueStoreInterface::has
NullStorageExpirable::rename public function Renames a key. Overrides KeyValueStoreInterface::rename
NullStorageExpirable::set public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::set(). Overrides KeyValueStoreInterface::set
NullStorageExpirable::setIfNotExists public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::setIfNotExists(). Overrides KeyValueStoreInterface::setIfNotExists
NullStorageExpirable::setMultiple public function Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::setMultiple(). Overrides KeyValueStoreInterface::setMultiple
NullStorageExpirable::setMultipleWithExpire public function Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setMultipleWithExpire(). Overrides KeyValueStoreExpirableInterface::setMultipleWithExpire
NullStorageExpirable::setWithExpire public function Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setWithExpire(). Overrides KeyValueStoreExpirableInterface::setWithExpire
NullStorageExpirable::setWithExpireIfNotExists public function Implements Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface::setWithExpireIfNotExists(). Overrides KeyValueStoreExpirableInterface::setWithExpireIfNotExists
NullStorageExpirable::__construct public function Creates a new expirable null key/value store.