WorkspaceNegotiatorInterface
interface WorkspaceNegotiatorInterface (View source)
Workspace negotiators provide a way to get the active workspace.
\Drupal\workspaces\WorkspaceManager acts as the service collector for Workspace negotiators.
Methods
bool
applies(Request $request)
Checks whether the negotiator applies to the current request or not.
WorkspaceInterface|null
getActiveWorkspace(Request $request)
Gets the negotiated workspace, if any.
unsetActiveWorkspace()
Unsets the negotiated workspace.
Details
bool
applies(Request $request)
Checks whether the negotiator applies to the current request or not.
WorkspaceInterface|null
getActiveWorkspace(Request $request)
Gets the negotiated workspace, if any.
Note that it is the responsibility of each implementation to check whether the negotiated workspace actually exists in the storage.
setActiveWorkspace(WorkspaceInterface $workspace)
Sets the negotiated workspace.
unsetActiveWorkspace()
Unsets the negotiated workspace.