PrivateTempStore::set

public PrivateTempStore::set($key, $value) Stores a particular key/value pair in this PrivateTempStore. Parameters string $key: The key of the data to store. mixed $value: The data to store. File core/modules/user/src/PrivateTempStore.php, line 116 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function set($key, $value) { $key = $this->createkey($key); if (!$this->lockBackend->acquire($key)) { $this->

PrivateTempStore::getOwner

protected PrivateTempStore::getOwner() Gets the current owner based on the current user or the session ID. Return value string The owner. File core/modules/user/src/PrivateTempStore.php, line 203 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected function getOwner() { return $this->currentUser->id() ? : $this->requestStack->getCurrentRequest()->getSession()->getId(); }

PrivateTempStore::getMetadata

public PrivateTempStore::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/PrivateTempStore.php, line 144 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function getMetadata($key) { $key = $this->cre

PrivateTempStore::get

public PrivateTempStore::get($key) 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 101 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 = $t

PrivateTempStore::delete

public PrivateTempStore::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. 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/PrivateTempStore.php, line 165 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code public function delete($key) { $k

PrivateTempStore::createkey

protected PrivateTempStore::createkey($key) Ensures that the key is unique for a user. Parameters string $key: The key. Return value string The unique key for the user. File core/modules/user/src/PrivateTempStore.php, line 193 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected function createkey($key) { return $this->getOwner() . ':' . $key; }

PrivateTempStore::$storage

The key/value storage object used for this data. Type: \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface File core/modules/user/src/PrivateTempStore.php, line 36 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $storage;

PrivateTempStore::$requestStack

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

PrivateTempStore::$lockBackend

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

PrivateTempStore::$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/PrivateTempStore.php, line 66 Class PrivateTempStore Stores and retrieves temporary data for a given owner. Namespace Drupal\user Code protected $expire;