You are here

public function SessionWorkspaceNegotiator::setActiveWorkspace in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::setActiveWorkspace()

Sets the negotiated workspace.

Parameters

\Drupal\workspaces\WorkspaceInterface $workspace: The workspace entity.

Overrides WorkspaceNegotiatorInterface::setActiveWorkspace

1 call to SessionWorkspaceNegotiator::setActiveWorkspace()
QueryParameterWorkspaceNegotiator::getActiveWorkspace in core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php
Gets the negotiated workspace, if any.

File

core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php, line 77

Class

SessionWorkspaceNegotiator
Defines the session workspace negotiator.

Namespace

Drupal\workspaces\Negotiator

Code

public function setActiveWorkspace(WorkspaceInterface $workspace) {
  $this->session
    ->set('active_workspace_id', $workspace
    ->id());
}