public function AccountSwitcherInterface::switchTo in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Session/AccountSwitcherInterface.php \Drupal\Core\Session\AccountSwitcherInterface::switchTo()
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.
1 method overrides AccountSwitcherInterface::switchTo()
- AccountSwitcher::switchTo in core/
lib/ Drupal/ Core/ Session/ AccountSwitcher.php - Safely switches to another account.
File
- core/
lib/ Drupal/ Core/ Session/ AccountSwitcherInterface.php, line 30 - Contains \Drupal\Core\Session\AccountSwitcherInterface.
Class
- AccountSwitcherInterface
- Defines an interface for a service for safe account switching.
Namespace
Drupal\Core\SessionCode
public function switchTo(AccountInterface $account);