function SerializableTempstoreFactory::__construct

Constructs a Drupal\Core\TempStore\SharedTempStoreFactory object.

Parameters

\Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface $storage_factory: The key/value store factory.

\Drupal\Core\Lock\LockBackendInterface $lock_backend: The lock object used for this data.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

int $expire: The time to live for items, in seconds.

\Drupal\Core\Session\AccountProxyInterface|null $current_user: The current logged user.

File

src/SerializableTempstoreFactory.php, line 41

Class

SerializableTempstoreFactory
A factory for creating SerializableTempStore objects.

Namespace

Drupal\ctools

Code

public function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, RequestStack $request_stack, $expire = 604800, AccountProxyInterface $current_user = NULL) {
    parent::__construct($storage_factory, $lock_backend, $request_stack, $expire);
    $this->currentUser = $current_user ?: \Drupal::currentUser();
}