You are here

function simplenews_newsletter_save in Simplenews 7

Same name and namespace in other branches
  1. 7.2 simplenews.module \simplenews_newsletter_save()

Store newsletter object in the database.

Parameters

$newsletter: Simplenews newsletter object.

Related topics

4 calls to simplenews_newsletter_save()
simplenews_newsletter_update_sent_status in ./simplenews.module
Update the sent status of a node.
simplenews_node_insert in ./simplenews.module
Implements hook_node_insert().
simplenews_node_tab_send_form_submit in includes/simplenews.admin.inc
@todo
simplenews_node_update in ./simplenews.module
Implements hook_node_update().

File

./simplenews.module, line 1994
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_newsletter_save($newsletter) {
  db_merge('simplenews_newsletter')
    ->key(array(
    'nid' => $newsletter->nid,
  ))
    ->fields(array(
    'tid' => $newsletter->tid,
    'status' => $newsletter->status,
  ))
    ->execute();
}