public function SliderDeleteForm::submitForm in Image sliders 8
Delete the entity and log the event. logger() replaces the watchdog.
Overrides ContentEntityForm::submitForm
File
- src/
Form/ SliderDeleteForm.php, line 44
Class
- SliderDeleteForm
- Provides a form for deleting a image_slider entity.
Namespace
Drupal\image_slider\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$entity = $this
->getEntity();
$entity
->delete();
$this
->logger('image_slider')
->notice('@type: deleted %title.', [
'@type' => $this->entity
->bundle(),
'%title' => $this->entity
->label(),
]);
$form_state
->setRedirect('entity.image_slider.collection');
}