AccountSwitcherInterface
interface AccountSwitcherInterface (View source)
Defines an interface for a service for safe account switching.
Methods
$this
$this
switchBack()
Reverts to a previous account after switching.
Details
$this
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.
$this
switchBack()
Reverts to a previous account after switching.