You are here

public function Ads::delete in SimpleAds 8

File

src/Ads.php, line 192

Class

Ads
Ads utility class.

Namespace

Drupal\simpleads

Code

public function delete() {
  if ($id = $this
    ->getId()) {
    $group = $this
      ->load();
    db_delete('simpleads')
      ->condition('id', $id)
      ->execute();
    drupal_set_message($this
      ->t('Advertisement <em>@name</em> successfully delete.', [
      '@name' => $group
        ->getAdName(),
    ]));
  }
}