function WorkspaceManager::executeOutsideWorkspace
Same name in other branches
- 9 core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::executeOutsideWorkspace()
- 10 core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::executeOutsideWorkspace()
- 11.x core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::executeOutsideWorkspace()
Overrides WorkspaceManagerInterface::executeOutsideWorkspace
File
-
core/
modules/ workspaces/ src/ WorkspaceManager.php, line 297
Class
- WorkspaceManager
- Provides the workspace manager.
Namespace
Drupal\workspacesCode
public function executeOutsideWorkspace(callable $function) {
$previous_active_workspace = $this->getActiveWorkspace();
$this->doSwitchWorkspace(NULL);
$result = $function();
$this->doSwitchWorkspace($previous_active_workspace);
return $result;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.