function WorkspaceMergeForm::submitForm

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

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

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