You are here

public function NewsletterNewsletterController::delete in Newsletter 7

1 call to NewsletterNewsletterController::delete()
NewsletterNewsletterController::deleteDraft in includes/newsletter.newsletter.controller.inc

File

includes/newsletter.newsletter.controller.inc, line 78
Controller class definition file for newsletter_newsletter entity.

Class

NewsletterNewsletterController
Newsletter Newsletter Controller

Code

public function delete($nnid) {
  $newsletter = newsletter_newsletter_load($nnid);
  $deleted = db_delete('newsletter_newsletter')
    ->condition('nnid', $nnid)
    ->execute();
  module_invoke_all('entity_delete', $newsletter, 'newsletter_newsletter');

  // It's necessary to clear the caches when an entity is deleted.
  cache_clear_all();
  $this
    ->resetCache();
  return $deleted ? TRUE : FALSE;
}