You are here

public function State::getKeyValue in Key 8

Returns the value of a key.

Parameters

\Drupal\key\KeyInterface $key: The key whose value will be retrieved.

Return value

string The key value.

Overrides KeyProviderInterface::getKeyValue

File

tests/modules/key_test/src/Plugin/KeyProvider/State.php, line 58

Class

State
Defines a key provider that stores in memory.

Namespace

Drupal\key_test\Plugin\KeyProvider

Code

public function getKeyValue(KeyInterface $key) {
  return $this->state
    ->get('key_test:' . $this->configuration['state_key']);
}