protected function AccountSwitcherTrait::switchToAdmin in Tome 8
Switches the current user to the admin.
2 calls to AccountSwitcherTrait::switchToAdmin()
- Exporter::exportContent in modules/
tome_sync/ src/ Exporter.php - Exports a content entity to the target storage.
- Importer::importContent in modules/
tome_sync/ src/ Importer.php - Imports a content entity from the source storage.
File
- modules/
tome_sync/ src/ AccountSwitcherTrait.php, line 22
Class
- AccountSwitcherTrait
- Shared methods for handling account switching.
Namespace
Drupal\tome_syncCode
protected function switchToAdmin() {
$this->accountSwitcher
->switchTo(new UserSession([
'uid' => 1,
]));
}