FlagListItemDeleteForm.php in Flag Lists 8
File
src/Form/FlagListItemDeleteForm.php
View source
<?php
namespace Drupal\flag_lists\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Form\FormStateInterface;
class FlagListItemDeleteForm extends ContentEntityDeleteForm {
public function buildForm(array $form, FormStateInterface $form_state) {
$entity = $this
->getEntity();
$form = parent::buildForm($form, $form_state);
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$entity = $this
->getEntity();
$entity
->delete();
$message = $this
->getDeletionMessage();
$this
->messenger()
->addStatus($message);
$this
->logDeletionMessage();
}
}