function WorkspaceSwitcherForm::__construct

Same name in other branches
  1. 9 core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
  2. 8.9.x core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
  3. 10 core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()

Constructs a new WorkspaceSwitcherForm.

Parameters

\Drupal\workspaces\WorkspaceManagerInterface $workspace_manager: The workspace manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

File

core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php, line 50

Class

WorkspaceSwitcherForm
Provides a form that activates a different workspace.

Namespace

Drupal\workspaces\Form

Code

public function __construct(WorkspaceManagerInterface $workspace_manager, EntityTypeManagerInterface $entity_type_manager, MessengerInterface $messenger) {
    $this->workspaceManager = $workspace_manager;
    $this->workspaceStorage = $entity_type_manager->getStorage('workspace');
    $this->messenger = $messenger;
}

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