You are here

public static function Drupal::keyValue in Drupal 9

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

15 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.
IdentifierFieldSchemaTypeUpdateTest::testSystemUpdate8901 in core/modules/system/tests/src/Functional/Update/IdentifierFieldSchemaTypeUpdateTest.php
Tests system_update_8901().

... See full list

File

core/lib/Drupal.php, line 463

Class

Drupal
Static Service Container wrapper.

Code

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