public function LocalTaskUnassignForm::submitForm

File

translators/tmgmt_local/src/Form/LocalTaskUnassignForm.php, line 42

Class

LocalTaskUnassignForm
Unassign task confirmation form.

Namespace

Drupal\tmgmt_local\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  /** @var LocalTask $entity */
  $entity = $this
    ->getEntity();
  $entity
    ->unassign();
  $entity
    ->save();
  $this
    ->messenger()
    ->addStatus(t('Unassigned from translation local task @label.', array(
    '@label' => $entity
      ->label(),
  )));
  $view = Views::getView('tmgmt_local_task_overview');
  $view
    ->initDisplay();
  $form_state
    ->setRedirect($view
    ->getUrl()
    ->getRouteName());
}