function WorkspaceCacheContext::getContext
Same name in other branches
- 8.9.x core/modules/workspaces/src/WorkspaceCacheContext.php \Drupal\workspaces\WorkspaceCacheContext::getContext()
- 10 core/modules/workspaces/src/WorkspaceCacheContext.php \Drupal\workspaces\WorkspaceCacheContext::getContext()
- 11.x core/modules/workspaces/src/WorkspaceCacheContext.php \Drupal\workspaces\WorkspaceCacheContext::getContext()
Overrides CacheContextInterface::getContext
File
-
core/
modules/ workspaces/ src/ WorkspaceCacheContext.php, line 42
Class
- WorkspaceCacheContext
- Defines the WorkspaceCacheContext service, for "per workspace" caching.
Namespace
Drupal\workspacesCode
public function getContext() {
return $this->workspaceManager
->hasActiveWorkspace() ? $this->workspaceManager
->getActiveWorkspace()
->id() : 'live';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.