You are here

public function SignupDeleteForm::submitForm in SendinBlue 8.2

Same name and namespace in other branches
  1. 8 src/Form/SignupDeleteForm.php \Drupal\sendinblue\Form\SignupDeleteForm::submitForm()

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

Overrides ContentEntityForm::submitForm

File

src/Form/SignupDeleteForm.php, line 44

Class

SignupDeleteForm
Provides a form for deleting a content_entity_example entity.

Namespace

Drupal\sendinblue\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $entity = $this
    ->getEntity();
  $entity
    ->delete();
  $this
    ->logger('sendinblue_signup_form')
    ->notice('@type: deleted %title.', [
    '@type' => $this->entity
      ->bundle(),
    '%title' => $this->entity
      ->label(),
  ]);
  $form_state
    ->setRedirect('entity.sendinblue_signup_form.collection');
}