You are here

public function PrivateTempStore::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/PrivateTempStore.php \Drupal\user\PrivateTempStore::__construct()

Constructs a new object for accessing data from a key/value store.

Parameters

KeyValueStoreExpirableInterface $storage: The key/value storage object used for this data. Each storage object represents a particular collection of data and will contain any number of key/value pairs.

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

mixed $owner: The owner key to store along with the data (e.g. a user or session ID).

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

File

core/modules/user/src/PrivateTempStore.php, line 87
Contains \Drupal\user\PrivateTempStore.

Class

PrivateTempStore
Stores and retrieves temporary data for a given owner.

Namespace

Drupal\user

Code

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