You are here

public function PrivateTempStoreFactory::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/TempStore/PrivateTempStoreFactory.php \Drupal\Core\TempStore\PrivateTempStoreFactory::__construct()

Constructs a Drupal\Core\TempStore\PrivateTempStoreFactory 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.

\Drupal\Core\Session\AccountProxyInterface $current_user: The current account.

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

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

File

core/lib/Drupal/Core/TempStore/PrivateTempStoreFactory.php, line 64

Class

PrivateTempStoreFactory
Creates a PrivateTempStore object for a given collection.

Namespace

Drupal\Core\TempStore

Code

public function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, $expire = 604800) {
  $this->storageFactory = $storage_factory;
  $this->lockBackend = $lock_backend;
  $this->currentUser = $current_user;
  $this->requestStack = $request_stack;
  $this->expire = $expire;
}