You are here

public function Campaigns::delete in SimpleAds 8

File

src/Campaigns.php, line 170

Class

Campaigns
Campaigns utility class.

Namespace

Drupal\simpleads

Code

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