You are here

public static function Drupal::keyValueExpirable in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal.php \Drupal::keyValueExpirable()
  2. 10 core/lib/Drupal.php \Drupal::keyValueExpirable()

Returns an expirable key value store collection.

Parameters

string $collection: The name of the collection holding key and value pairs.

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface An expirable key value store collection.

1 call to Drupal::keyValueExpirable()
DrupalTest::testKeyValueExpirable in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the keyValueExpirable() method.

File

core/lib/Drupal.php, line 356
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function keyValueExpirable($collection) {
  return static::getContainer()
    ->get('keyvalue.expirable')
    ->get($collection);
}