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

Gets an object from the temp store.


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


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


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;