You are here

public function DeleteBannerForm::dynamic_banner_admin_delete in Dynamic Banner 8

Post-confirmation; delete a Banner

1 call to DeleteBannerForm::dynamic_banner_admin_delete()
DeleteBannerForm::submitForm in src/forms/DeleteBannerForm.php
Form submission handler.

File

src/forms/DeleteBannerForm.php, line 58

Class

DeleteBannerForm

Namespace

Drupal\dynamic_banner\forms

Code

public 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'));
}