function TempStore::get

Retrieves a value from this TempStore for a given key.

Parameters

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

Return value

mixed The data associated with the key, or NULL if the key does not exist.

File

drupal/core/modules/user/lib/Drupal/user/TempStore.php, line 103
Contains Drupal\user\TempStore.

Class

TempStore
Stores and retrieves temporary data for a given owner.

Namespace

Drupal\user

Code

function get($key) {
  if ($object = $this->storage
    ->get($key)) {
    return $object->data;
  }
}