You are here

public function DomainPathDeleteForm::submitForm in Domain Path 8

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

Overrides ContentEntityDeleteForm::submitForm

File

src/Form/DomainPathDeleteForm.php, line 43

Class

DomainPathDeleteForm
Provides a form for deleting a domain_path entity.

Namespace

Drupal\domain_path\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $entity = $this
    ->getEntity();
  $entity
    ->delete();
  $this
    ->logger('domain_path')
    ->notice('deleted %id.', [
    '%id' => $this->entity
      ->id(),
  ]);

  // Redirect to domain path list after delete.
  $form_state
    ->setRedirect('entity.domain_path.collection');
}