You are here

public static function Drupal::keyValue in Drupal 8

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

Returns a key/value storage collection.

Parameters

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

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreInterface

17 calls to Drupal::keyValue()
DrupalTest::testKeyValue in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the keyValue() method.
EntityAutocomplete::processEntityAutocomplete in core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
Adds entity autocomplete functionality to a form element.
EntitySchemaTest::testCleanUpStorageDefinition in core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
Tests fields from an uninstalled module are removed from the schema.
EntitySchemaTest::testIdentifierSchema in core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
Tests the installed storage schema for identifier fields.
EntityUpdateToPublishableTest::setUp in core/modules/system/tests/src/Functional/Update/EntityUpdateToPublishableTest.php
Overrides WebTestBase::setUp() for update testing.

... See full list

File

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

Class

Drupal
Static Service Container wrapper.

Code

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