class SerializableTempstoreFactory
A factory for creating SerializableTempStore objects.
Hierarchy
- class \Drupal\Core\TempStore\SharedTempStoreFactory
- class \Drupal\ctools\SerializableTempstoreFactory implements \Drupal\Core\TempStore\SharedTempStoreFactory
Expanded class hierarchy of SerializableTempstoreFactory
Deprecated
in ctools 8.x-3.10. Will be removed before ctools:4.0.0. Use \Drupal\Core\TempStore\SharedTempStoreFactory instead.
1 string reference to 'SerializableTempstoreFactory'
1 service uses SerializableTempstoreFactory
File
-
src/
SerializableTempstoreFactory.php, line 18
Namespace
Drupal\ctoolsView source
class SerializableTempstoreFactory extends SharedTempStoreFactory {
/**
* {@inheritdoc}
*/
public function get($collection, $owner = NULL) {
// Use the currently authenticated user ID or the active user ID unless the
// owner is overridden.
if (!isset($owner)) {
$owner = $this->currentUser
->id() ?: session_id();
}
// Store the data for this collection in the database.
$storage = $this->storageFactory
->get("tempstore.shared.{$collection}");
return new CoreSharedTempStore($storage, $this->lockBackend, $owner, $this->requestStack, $this->currentUser, $this->expire);
}
}