function AddBannerForm::dynamic_banner_admin_delete in Dynamic Banner 8
Post-confirmation; delete a Banner
File
- src/
forms/ AddBannerForm.php, line 398
Class
Namespace
Drupal\dynamic_banner\formsCode
function dynamic_banner_admin_delete($dbid = 0) {
// TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
// You will need to use `\Drupal\core\Database\Database::getConnection()` if you do not yet have access to the container here.
\Drupal::database()
->delete('dynamic_banner')
->condition('dbid', $dbid)
->execute();
$this
->messenger()
->addStatus(t('The banner has been deleted, the image still exists though'));
}