function Drupal::keyValueExpirable

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::keyValueExpirable()
  2. 8.9.x core/lib/Drupal.php \Drupal::keyValueExpirable()
  3. 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 380

Class

Drupal
Static Service Container wrapper.

Code

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

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