AccountSwitcherInterface::switchTo

public AccountSwitcherInterface::switchTo(AccountInterface $account)

Safely switches to another account.

Each invocation of AccountSwitcherInterface::switchTo() must be matched by a corresponding invocation of AccountSwitcherInterface::switchBack() in the same function.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account to switch to.

Return value

\Drupal\Core\Session\AccountSwitcherInterface $this.

File

core/lib/Drupal/Core/Session/AccountSwitcherInterface.php, line 25

Class

AccountSwitcherInterface
Defines an interface for a service for safe account switching.

Namespace

Drupal\Core\Session

Code

public function switchTo(AccountInterface $account);
doc_Drupal
2016-10-29 08:42:58
Comments
Leave a Comment

Please login to continue.