Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::keyValue()
  2. 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

26 calls to Drupal::keyValue()
ActiveWorkspaceUpdateTest::setUp in core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php
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.
EntityAutocompleteTest::getAutocompleteResult in core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php
Returns the result of an Entity reference autocomplete request.
EntityAutocompleteTest::testSelectionSettingsHandling in core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php
Tests that missing or invalid selection setting key are handled correctly.

... See full list

File

core/lib/Drupal.php, line 465

Class

Drupal
Static Service Container wrapper.

Code

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