comparison core/lib/Drupal/Core/Session/AccountProxyInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Session;
4
5 /**
6 * Defines an interface for a service which has the current account stored.
7 *
8 * @ingroup user_api
9 */
10 interface AccountProxyInterface extends AccountInterface {
11
12 /**
13 * Sets the currently wrapped account.
14 *
15 * Setting the current account is highly discouraged! Instead, make sure to
16 * inject the desired user object into the dependent code directly.
17 *
18 * A preferable method of account impersonation is to use
19 * \Drupal\Core\Session\AccountSwitcherInterface::switchTo() and
20 * \Drupal\Core\Session\AccountSwitcherInterface::switchBack().
21 *
22 * @param \Drupal\Core\Session\AccountInterface $account
23 * The current account.
24 */
25 public function setAccount(AccountInterface $account);
26
27 /**
28 * Gets the currently wrapped account.
29 *
30 * @return \Drupal\Core\Session\AccountInterface
31 * The current account.
32 */
33 public function getAccount();
34
35 /**
36 * Sets the id of the initial account.
37 *
38 * Never use this method, its sole purpose is to work around weird effects
39 * during mid-request container rebuilds.
40 *
41 * @param int $account_id
42 * The id of the initial account.
43 */
44 public function setInitialAccountId($account_id);
45
46 }