8.5.x Drupal.php Drupal::keyValue($collection)
8.0.x Drupal.php Drupal::keyValue($collection)
8.1.x Drupal.php Drupal::keyValue($collection)
8.2.x Drupal.php Drupal::keyValue($collection)
8.3.x Drupal.php Drupal::keyValue($collection)
8.4.x Drupal.php Drupal::keyValue($collection)
8.6.x Drupal.php Drupal::keyValue($collection)

Returns a key/value storage collection.

Parameters

string $collection: Name of the key/value collection to return.

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreInterface

File

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

Class

Drupal
Static Service Container wrapper.

Code

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