Chris@0: storageFactory = $storage_factory; Chris@0: $this->lockBackend = $lock_backend; Chris@0: $this->currentUser = $current_user; Chris@0: $this->requestStack = $request_stack; Chris@0: $this->expire = $expire; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Creates a PrivateTempStore. Chris@0: * Chris@0: * @param string $collection Chris@0: * The collection name to use for this key/value store. This is typically Chris@0: * a shared namespace or module name, e.g. 'views', 'entity', etc. Chris@0: * Chris@0: * @return \Drupal\user\PrivateTempStore Chris@0: * An instance of the key/value store. Chris@0: */ Chris@0: public function get($collection) { Chris@0: // Store the data for this collection in the database. Chris@0: $storage = $this->storageFactory->get("user.private_tempstore.$collection"); Chris@0: return new PrivateTempStore($storage, $this->lockBackend, $this->currentUser, $this->requestStack, $this->expire); Chris@0: } Chris@0: Chris@0: }