You are here

function newsletter_create in Newsletter 7

Same name and namespace in other branches
  1. 7.2 newsletter.module \newsletter_create()

Instantiates a new Newsletter class according to http://drupal.org/node/608152.

Return value

A newsletter object.

1 call to newsletter_create()
newsletter_node_insert in ./newsletter.module
Implements hook_node_insert().

File

./newsletter.module, line 1104
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_create($nlid = NULL, $ntid = NULL, $nnid = NULL) {
  if (isset($ntid)) {
    $newsletter = new NewsletterCustom($nlid, $ntid, $nnid);
  }
  elseif (isset($nlid) && !isset($ntid)) {
    $newsletter = new NewsletterAutomated($nlid);
  }
  else {
    $newsletter = new NewsletterBasic();
  }
  return (object) $newsletter;
}