You are here

public function PresentationDeleteForm::submitForm in Isotope (with Masonry and Packery) 8

The submit handler for the confirm form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: An associative array containing the current state of the form.

Overrides EntityForm::submitForm

File

src/Form/PresentationDeleteForm.php, line 74
Contains Drupal\isotope\Form\PresentationDeleteForm.

Class

PresentationDeleteForm
Class PresentationDeleteForm.

Namespace

Drupal\isotope\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Delete the entity.
  $this->entity
    ->delete();

  // Set a message that the entity was deleted.
  drupal_set_message($this
    ->t('Presentation %label was deleted.', [
    '%label' => $this->entity
      ->label(),
  ]));

  // Redirect the user to the list controller when complete.
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}