class PrivateTempStoreFactory extends PrivateTempStoreFactory (View source)

deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead.

Creates a PrivateTempStore object for a given collection.

Properties

protected KeyValueExpirableFactoryInterface $storageFactory

The storage factory creating the backend to store the data.

from  PrivateTempStoreFactory
protected LockBackendInterface $lockBackend

The lock object used for this data.

from  PrivateTempStoreFactory
protected AccountProxyInterface $currentUser

The current user.

from  PrivateTempStoreFactory
protected RequestStack $requestStack

The request stack.

from  PrivateTempStoreFactory
protected int $expire

The time to live for items in seconds.

from  PrivateTempStoreFactory

Methods

__construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, int $expire = 604800)

Constructs a Drupal\Core\TempStore\PrivateTempStoreFactory object.

get(string $collection)

Creates a PrivateTempStore.

Details

__construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, int $expire = 604800)

Constructs a Drupal\Core\TempStore\PrivateTempStoreFactory object.

Parameters

KeyValueExpirableFactoryInterface $storage_factory

The key/value store factory.

LockBackendInterface $lock_backend

The lock object used for this data.

AccountProxyInterface $current_user

The current account.

RequestStack $request_stack

The request stack.

int $expire

The time to live for items, in seconds.

PrivateTempStore get(string $collection)

Creates a PrivateTempStore.

Parameters

string $collection

The collection name to use for this key/value store. This is typically a shared namespace or module name, e.g. 'views', 'entity', etc.

Return Value

PrivateTempStore

An instance of the key/value store.