You are here

public function PrivateTempStore::get in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/PrivateTempStore.php \Drupal\user\PrivateTempStore::get()

Retrieves a value from this PrivateTempStore 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

core/modules/user/src/PrivateTempStore.php, line 104
Contains \Drupal\user\PrivateTempStore.

Class

PrivateTempStore
Stores and retrieves temporary data for a given owner.

Namespace

Drupal\user

Code

public function get($key) {
  $key = $this
    ->createkey($key);
  if (($object = $this->storage
    ->get($key)) && $object->owner == $this
    ->getOwner()) {
    return $object->data;
  }
}