You are here

public function NewsletterNewsletterController::save in Newsletter 7

Saves a newsletter to database.

Parameters

$newsletter: A full newsletter object.

File

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

Class

NewsletterNewsletterController
Newsletter Newsletter Controller

Code

public function save($newsletter) {
  if (empty($newsletter->nnid)) {
    return isset($newsletter->title) && isset($newsletter->ntid) ? $this
      ->saveNew($newsletter) : FALSE;
  }
  drupal_write_record('newsletter_newsletter', $newsletter, 'nnid');
  field_attach_update('newsletter_newsletter', $newsletter);
  module_invoke_all('entity_update', $newsletter, 'newsletter_newsletter');
}