SharedTempStore::getMetadata

public SharedTempStore::getMetadata($key) Returns the metadata associated with a particular key/value pair. Parameters string $key: The key of the data to store. Return value mixed An object with the owner and updated time if the key has a value, or NULL otherwise. File core/modules/user/src/SharedTempStore.php, line 216 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function getMetadata($key) { // Fetch the key/value

SharedTempStore::delete

public SharedTempStore::delete($key) Deletes data from the store for a given key and releases the lock on it. Parameters string $key: The key of the data to delete. File core/modules/user/src/SharedTempStore.php, line 232 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function delete($key) { if (!$this->lockBackend->acquire($key)) { $this->lockBackend->wait($key); if (!$this->lockBackend->acqui

SharedTempStore::get

public SharedTempStore::get($key) Retrieves a value from this SharedTempStore 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/SharedTempStore.php, line 110 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function get($key) { if ($object = $this->storage->get($key)) { retu

SharedTempStore::getIfOwner

public SharedTempStore::getIfOwner($key) Retrieves a value from this SharedTempStore for a given key. Only returns the value if the value is owned by $this->owner. 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/SharedTempStore.php, line 127 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function

SharedTempStore::deleteIfOwner

public SharedTempStore::deleteIfOwner($key) Deletes data from the store for a given key and releases the lock on it. Only delete the given key if it is owned by $this->owner. Parameters string $key: The key of the data to delete. Return value bool TRUE if the object was deleted or does not exist, FALSE if it exists but is not owned by $this->owner. File core/modules/user/src/SharedTempStore.php, line 255 Class SharedTempStore Stores and retrieves temporary data for a given owner.

SharedTempStore::$expire

The time to live for items in seconds. By default, data is stored for one week (604800 seconds) before expiring. Type: int File core/modules/user/src/SharedTempStore.php, line 75 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $expire;

SharedTempStore::$requestStack

The request stack. Type: \Symfony\Component\HttpFoundation\RequestStack File core/modules/user/src/SharedTempStore.php, line 59 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $requestStack;

SharedTempStore::$lockBackend

The lock object used for this data. Type: \Drupal\Core\Lock\LockBackendInterface File core/modules/user/src/SharedTempStore.php, line 52 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $lockBackend;

SharedTempStore::$owner

The owner key to store along with the data (e.g. a user or session ID). Type: mixed File core/modules/user/src/SharedTempStore.php, line 66 Class SharedTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $owner;

SharedTempStore

Stores and retrieves temporary data for a given owner. A SharedTempStore can be used to make temporary, non-cache data available across requests. The data for the SharedTempStore is stored in one key/value collection. SharedTempStore data expires automatically after a given timeframe. The SharedTempStore is different from a cache, because the data in it is not yet saved permanently and so it cannot be rebuilt. Typically, the SharedTempStore might be used to store work in progress that is later