You are here

public function WorkspaceMergeForm::submitForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workspaces/src/Form/WorkspaceMergeForm.php \Drupal\workspaces\Form\WorkspaceMergeForm::submitForm()
  2. 10 core/modules/workspaces/src/Form/WorkspaceMergeForm.php \Drupal\workspaces\Form\WorkspaceMergeForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

core/modules/workspaces/src/Form/WorkspaceMergeForm.php, line 145

Class

WorkspaceMergeForm
Provides a form that merges the contents for a workspace into another one.

Namespace

Drupal\workspaces\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->workspaceOperationFactory
    ->getMerger($this->sourceWorkspace, $this->targetWorkspace)
    ->merge();
  $this
    ->messenger()
    ->addMessage($this
    ->t('The contents of the %source_label workspace have been merged into %target_label.', [
    '%source_label' => $this->sourceWorkspace
      ->label(),
    '%target_label' => $this->targetWorkspace
      ->label(),
  ]));
}