You are here

public function IndexDeleteConfirmForm::submitForm in Search API 8

Overrides EntityDeleteFormTrait::submitForm

File

src/Form/IndexDeleteConfirmForm.php, line 66

Class

IndexDeleteConfirmForm
Defines a confirm form for deleting an index.

Namespace

Drupal\search_api\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->delete();
  $this->messenger
    ->addStatus($this
    ->t('The search index %name has been removed.', [
    '%name' => $this->entity
      ->label(),
  ]));
  $form_state
    ->setRedirect('search_api.overview');
}