You are here

public function EckEntityBundleDeleteConfirm::submitForm in Entity Construction Kit (ECK) 8

Overrides EntityDeleteFormTrait::submitForm

File

src/Form/EntityBundle/EckEntityBundleDeleteConfirm.php, line 88

Class

EckEntityBundleDeleteConfirm
Provides a form for ECK entity bundle deletion.

Namespace

Drupal\eck\Form\EntityBundle

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->delete();
  $t_args = [
    '%name' => $this->entity
      ->label(),
  ];
  \Drupal::messenger()
    ->addMessage($this
    ->t('The entity bundle %name has been deleted', $t_args));
  $this
    ->logger($this->entity
    ->getEntityType()
    ->getBundleOf())
    ->notice('Delete entity type %name', $t_args);
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}