public function WorkspaceSwitcherForm::__construct in Drupal 9
Same name and namespace in other branches
- 8 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 49
Class
- WorkspaceSwitcherForm
- Provides a form that activates a different workspace.
Namespace
Drupal\workspaces\FormCode
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;
}