function WorkspaceManager::hasActiveWorkspace

Same name and namespace in other branches
  1. 11.x core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::hasActiveWorkspace()
  2. 10 core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::hasActiveWorkspace()
  3. 9 core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::hasActiveWorkspace()
  4. 8.9.x core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::hasActiveWorkspace()

Determines whether a workspace is active in the current request.

Return value

bool TRUE if a workspace is active, FALSE otherwise.

Overrides WorkspaceManagerInterface::hasActiveWorkspace

File

core/modules/workspaces/src/WorkspaceManager.php, line 36

Class

WorkspaceManager
Provides the workspace manager.

Namespace

Drupal\workspaces

Code

public function hasActiveWorkspace() {
  return $this->getActiveWorkspace() !== NULL;
}

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