function WorkspaceMergeForm::submitForm

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

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(),
  ]));
}

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