You are here

public function LocaleProjectStorage::get in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/locale/src/LocaleProjectStorage.php \Drupal\locale\LocaleProjectStorage::get()

Returns the stored value for a given key.

Parameters

string $key: The key of the data to retrieve.

mixed $default: The default value to use if the key is not found.

Return value

mixed The stored value, or the default value if no value exists.

Overrides LocaleProjectStorageInterface::get

File

core/modules/locale/src/LocaleProjectStorage.php, line 46

Class

LocaleProjectStorage
Provides the locale project storage system using a key value store.

Namespace

Drupal\locale

Code

public function get($key, $default = NULL) {
  $values = $this
    ->getMultiple([
    $key,
  ]);
  return isset($values[$key]) ? $values[$key] : $default;
}