comparison core/modules/user/src/PrivateTempStoreFactory.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
1 <?php 1 <?php
2 2
3 namespace Drupal\user; 3 namespace Drupal\user;
4 4
5 use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface; 5 use Drupal\Core\TempStore\PrivateTempStoreFactory as CorePrivateTempStoreFactory;
6 use Drupal\Core\Lock\LockBackendInterface; 6
7 use Drupal\Core\Session\AccountProxyInterface; 7 @trigger_error('\Drupal\user\PrivateTempStoreFactory is scheduled for removal in Drupal 9.0.0. Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead. See https://www.drupal.org/node/2935639.', E_USER_DEPRECATED);
8 use Symfony\Component\HttpFoundation\RequestStack;
9 8
10 /** 9 /**
11 * Creates a PrivateTempStore object for a given collection. 10 * Creates a PrivateTempStore object for a given collection.
11 *
12 * @deprecated in Drupal 8.5.x, to be removed before Drupal 9.0.0.
13 * Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead.
14 *
15 * @see \Drupal\Core\TempStore\PrivateTempStoreFactory
16 * @see https://www.drupal.org/node/2935639
12 */ 17 */
13 class PrivateTempStoreFactory { 18 class PrivateTempStoreFactory extends CorePrivateTempStoreFactory {
14
15 /**
16 * The storage factory creating the backend to store the data.
17 *
18 * @var \Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface
19 */
20 protected $storageFactory;
21
22 /**
23 * The lock object used for this data.
24 *
25 * @var \Drupal\Core\Lock\LockBackendInterface
26 */
27 protected $lockBackend;
28
29 /**
30 * The current user.
31 *
32 * @var \Drupal\Core\Session\AccountProxyInterface
33 */
34 protected $currentUser;
35
36 /**
37 * The request stack.
38 *
39 * @var \Symfony\Component\HttpFoundation\RequestStack
40 */
41 protected $requestStack;
42
43 /**
44 * The time to live for items in seconds.
45 *
46 * @var int
47 */
48 protected $expire;
49
50 /**
51 * Constructs a Drupal\user\PrivateTempStoreFactory object.
52 *
53 * @param \Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface $storage_factory
54 * The key/value store factory.
55 * @param \Drupal\Core\Lock\LockBackendInterface $lock_backend
56 * The lock object used for this data.
57 * @param \Drupal\Core\Session\AccountProxyInterface $current_user
58 * The current account.
59 * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
60 * The request stack.
61 * @param int $expire
62 * The time to live for items, in seconds.
63 */
64 public function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, $expire = 604800) {
65 $this->storageFactory = $storage_factory;
66 $this->lockBackend = $lock_backend;
67 $this->currentUser = $current_user;
68 $this->requestStack = $request_stack;
69 $this->expire = $expire;
70 }
71 19
72 /** 20 /**
73 * Creates a PrivateTempStore. 21 * Creates a PrivateTempStore.
74 * 22 *
75 * @param string $collection 23 * @param string $collection