workspaceManager = $workspace_manager; } /** * {@inheritdoc} */ public static function getLabel() { return t('Workspace'); } /** * {@inheritdoc} */ public function getContext() { return $this->workspaceManager->getActiveWorkspace()->id(); } /** * {@inheritdoc} */ public function getCacheableMetadata($type = NULL) { // The active workspace will always be stored in the user's session. $cacheability = new CacheableMetadata(); $cacheability->addCacheContexts(['session']); return $cacheability; } }