You are here

public function SimplenewsSourceNode::__construct in Simplenews 7

Same name and namespace in other branches
  1. 7.2 includes/simplenews.source.inc \SimplenewsSourceNode::__construct()

Implements SimplenewsSourceInterface::_construct();

Overrides SimplenewsSourceNodeInterface::__construct

File

includes/simplenews.source.inc, line 384
Contains SimplenewsSource interface and implementations.

Class

SimplenewsSourceNode
Simplenews source implementation based on nodes for a single subscriber.

Code

public function __construct($node, $subscriber) {
  $this
    ->setSubscriber($subscriber);
  $this
    ->setNode($node);
  $this->newsletter = simplenews_newsletter_load($node->nid);
  $this->category = simplenews_category_load($this->newsletter->tid);
  $this
    ->initCache();
}