You are here

public static function Drupal::keyValueExpirable in Drupal 9

Same name and namespace in other branches
  1. 8 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 379

Class

Drupal
Static Service Container wrapper.

Code

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