You are here

public function SessionBasedTempStore::get in Session Based Temporary Storage 8

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.

Throws

\Drupal\Core\TempStore\TempStoreException

File

src/SessionBasedTempStore.php, line 134

Class

SessionBasedTempStore
Stores and retrieves temporary data for a given owner.

Namespace

Drupal\session_based_temp_store

Code

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