3 namespace Drupal\ctools;
5 use Drupal\user\SharedTempStoreFactory;
8 * A factory for creating SerializableTempStore objects.
10 class SerializableTempstoreFactory extends SharedTempStoreFactory {
15 function get($collection, $owner = NULL) {
16 // Use the currently authenticated user ID or the active user ID unless the
17 // owner is overridden.
19 $owner = \Drupal::currentUser()->id() ?: session_id();
22 // Store the data for this collection in the database.
23 $storage = $this->storageFactory->get("user.shared_tempstore.$collection");
24 return new SerializableTempstore($storage, $this->lockBackend, $owner, $this->requestStack, $this->expire);