1 common.inc tempstore_get($collection, $name)

Gets an object from the temp store.

Parameters

string $collection: A string defining the collection or group indicator. Must be less than 128 characters.

string $name: The name of the object being stored. Must be less than 128 characters.

Return value

The data that was stored.

Related topics

File

core/includes/common.inc, line 1588
Common functions that many Backdrop modules will need to reference.

Code

function tempstore_get($collection, $name) {
  $data = db_query('SELECT * FROM {tempstore} WHERE collection = :collection AND name = :name', array(':collection' => $collection, ':name' => $name))->fetchObject();
  if ($data) {
    $data = unserialize($data->value);
  }
  return $data;
}