You are here

public function StorageBase::get in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Core/KeyValueStore/StorageBase.php \Drupal\Core\KeyValueStore\StorageBase::get()

Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::get().

Overrides KeyValueStoreInterface::get

1 method overrides StorageBase::get()
MemoryStorage::get in lib/Drupal/Core/KeyValueStore/MemoryStorage.php
Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::get().

File

lib/Drupal/Core/KeyValueStore/StorageBase.php, line 39
Contains \Drupal\Core\KeyValueStore\StorageBase.

Class

StorageBase
Provides a base class for key/value storage implementations.

Namespace

Drupal\Core\KeyValueStore

Code

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