public function LtiToolProviderConsumerDeleteForm::submitForm in LTI Tool Provider 8
Same name and namespace in other branches
- 2.x src/Form/LtiToolProviderConsumerDeleteForm.php \Drupal\lti_tool_provider\Form\LtiToolProviderConsumerDeleteForm::submitForm()
Delete the entity and log the event. log() replaces the watchdog.
Overrides ContentEntityForm::submitForm
File
- src/
Form/ LtiToolProviderConsumerDeleteForm.php, line 48
Class
- LtiToolProviderConsumerDeleteForm
- Form for deleting a lti_tool_provider_consumer entity.
Namespace
Drupal\lti_tool_provider\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$entity = $this
->getEntity();
try {
$entity
->delete();
Drupal::logger('lti_tool_provider')
->notice('@type: deleted %title.', [
'@type' => $this->entity
->bundle(),
'%title' => $this->entity
->label(),
]);
} catch (EntityStorageException $e) {
Drupal::logger('lti_tool_provider')
->error('@type: error deleting %title.', [
'@type' => $this->entity
->bundle(),
'%title' => $this->entity
->label(),
]);
}
$form_state
->setRedirect('entity.lti_tool_provider_consumer.collection');
}