You are here

public function SimpleMegaMenuTypeDeleteForm::submitForm in Simple Mega Menu 8

Same name and namespace in other branches
  1. 2.0.x src/Form/SimpleMegaMenuTypeDeleteForm.php \Drupal\simple_megamenu\Form\SimpleMegaMenuTypeDeleteForm::submitForm()

Overrides EntityDeleteFormTrait::submitForm

File

src/Form/SimpleMegaMenuTypeDeleteForm.php, line 56

Class

SimpleMegaMenuTypeDeleteForm
Builds the form to delete Simple mega menu type entities.

Namespace

Drupal\simple_megamenu\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->delete();
  $this
    ->messenger()
    ->addStatus($this
    ->t('content @type: deleted @label.', [
    '@type' => $this->entity
      ->bundle(),
    '@label' => $this->entity
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}