function WorkspaceSwitcherForm::__construct

Same name in this branch
  1. 11.x core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
Same name and namespace in other branches
  1. 10 core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
  2. 9 core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
  3. 8.9.x core/modules/workspaces/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces\Form\WorkspaceSwitcherForm::__construct()
  4. main core/modules/workspaces_ui/src/Form/WorkspaceSwitcherForm.php \Drupal\workspaces_ui\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.

\Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface $selection_manager: The entity reference selection plugin manager.

File

core/modules/workspaces_ui/src/Form/WorkspaceSwitcherForm.php, line 60

Class

WorkspaceSwitcherForm
Provides a form that activates a different workspace.

Namespace

Drupal\workspaces_ui\Form

Code

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

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