You are here

public function MessageDeleteForm::submitForm in Message UI 8

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

Overrides ContentEntityForm::submitForm

File

src/Form/MessageDeleteForm.php, line 44

Class

MessageDeleteForm
Provides a form for deleting a message_ui entity.

Namespace

Drupal\message_ui\Form

Code

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