function AdminAccountSwitcher::switchTo

Same name in other branches
  1. 11.x core/lib/Drupal/Core/DefaultContent/AdminAccountSwitcher.php \Drupal\Core\DefaultContent\AdminAccountSwitcher::switchTo()
1 call to AdminAccountSwitcher::switchTo()
AdminAccountSwitcher::switchToAdministrator in core/lib/Drupal/Core/DefaultContent/AdminAccountSwitcher.php
Switches to an administrative account.

File

core/lib/Drupal/Core/DefaultContent/AdminAccountSwitcher.php, line 70

Class

AdminAccountSwitcher
@internal This API is experimental.

Namespace

Drupal\Core\DefaultContent

Code

public function switchTo(AccountInterface $account) : AccountSwitcherInterface {
    $this->decorated
        ->switchTo($account);
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.