class PrivateTempStoreFactory in Drupal 8
Same name in this branch
- 8 core/modules/user/src/PrivateTempStoreFactory.php \Drupal\user\PrivateTempStoreFactory
- 8 core/lib/Drupal/Core/TempStore/PrivateTempStoreFactory.php \Drupal\Core\TempStore\PrivateTempStoreFactory
Creates a PrivateTempStore object for a given collection.
Hierarchy
- class \Drupal\Core\TempStore\PrivateTempStoreFactory
- class \Drupal\user\PrivateTempStoreFactory
Expanded class hierarchy of PrivateTempStoreFactory
Deprecated
in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead.
See also
\Drupal\Core\TempStore\PrivateTempStoreFactory
https://www.drupal.org/node/2935639
1 string reference to 'PrivateTempStoreFactory'
- user.services.yml in core/
modules/ user/ user.services.yml - core/modules/user/user.services.yml
1 service uses PrivateTempStoreFactory
- user.private_tempstore in core/
modules/ user/ user.services.yml - Drupal\user\PrivateTempStoreFactory
File
- core/
modules/ user/ src/ PrivateTempStoreFactory.php, line 18
Namespace
Drupal\userView source
class PrivateTempStoreFactory extends CorePrivateTempStoreFactory {
/**
* Creates a PrivateTempStore.
*
* @param string $collection
* The collection name to use for this key/value store. This is typically
* a shared namespace or module name, e.g. 'views', 'entity', etc.
*
* @return \Drupal\user\PrivateTempStore
* An instance of the key/value store.
*/
public function get($collection) {
// Store the data for this collection in the database.
$storage = $this->storageFactory
->get("user.private_tempstore.{$collection}");
return new PrivateTempStore($storage, $this->lockBackend, $this->currentUser, $this->requestStack, $this->expire);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PrivateTempStoreFactory:: |
protected | property | The current user. | |
PrivateTempStoreFactory:: |
protected | property | The time to live for items in seconds. | |
PrivateTempStoreFactory:: |
protected | property | The lock object used for this data. | |
PrivateTempStoreFactory:: |
protected | property | The request stack. | |
PrivateTempStoreFactory:: |
protected | property | The storage factory creating the backend to store the data. | |
PrivateTempStoreFactory:: |
public | function |
Creates a PrivateTempStore. Overrides PrivateTempStoreFactory:: |
|
PrivateTempStoreFactory:: |
public | function | Constructs a Drupal\Core\TempStore\PrivateTempStoreFactory object. |