You are here

public function TokenCustomDeleteForm::submitForm in Custom Tokens 8

Delete the entity and log the event. logger() replaces the watchdog.

Overrides ContentEntityForm::submitForm

File

src/Form/TokenCustomDeleteForm.php, line 42

Class

TokenCustomDeleteForm
Provides a confirmation form for deleting a custom token entity.

Namespace

Drupal\token_custom\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $entity = $this
    ->getEntity();
  $entity
    ->delete();
  $form_state
    ->setRedirect('entity.token_custom.collection');
}