You are here

public function ApiKeyDeleteConfirmForm::submitForm in Services API Key Authentication 8.2

Same name and namespace in other branches
  1. 3.0.x src/Form/ApiKeyDeleteConfirmForm.php \Drupal\services_api_key_auth\Form\ApiKeyDeleteConfirmForm::submitForm()
  2. 2.0.x src/Form/ApiKeyDeleteConfirmForm.php \Drupal\services_api_key_auth\Form\ApiKeyDeleteConfirmForm::submitForm()

Overrides EntityDeleteFormTrait::submitForm

File

src/Form/ApiKeyDeleteConfirmForm.php, line 73

Class

ApiKeyDeleteConfirmForm
Defines a confirm form for deleting a server.

Namespace

Drupal\services_api_key_auth\Form

Code

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