You are here

public function MergeTerms::submitForm in Term Merge 8

Plugin annotation

@SuppressWarnings(camelCase);

Overrides FormInterface::submitForm

File

src/Form/MergeTerms.php, line 126

Class

MergeTerms
Term merge form.

Namespace

Drupal\term_merge\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $selectedTerms = $form_state
    ->getValue('terms');
  $termStore = $this->tempStoreFactory
    ->get('term_merge');
  $termStore
    ->set('terms', $selectedTerms);
  $routeName = 'entity.taxonomy_vocabulary.merge_target';
  $routeParameters['taxonomy_vocabulary'] = $this->vocabulary
    ->id();
  $form_state
    ->setRedirect($routeName, $routeParameters);
}