public function StorageBase::get in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/KeyValueStore/StorageBase.php \Drupal\Core\KeyValueStore\StorageBase::get()
- 9 core/lib/Drupal/Core/KeyValueStore/StorageBase.php \Drupal\Core\KeyValueStore\StorageBase::get()
File
- core/
lib/ Drupal/ Core/ KeyValueStore/ StorageBase.php, line 34
Class
- StorageBase
- Provides a base class for key/value storage implementations.
Namespace
Drupal\Core\KeyValueStoreCode
public function get($key, $default = NULL) {
$values = $this
->getMultiple([
$key,
]);
return $values[$key] ?? $default;
}