You are here

public function Notifications_Content_Subscription::set_node in Notifications 7

Set all the fields we can from node

1 call to Notifications_Content_Subscription::set_node()
Notifications_User_Content_Subscription::set_node in notifications_user/notifications_user.inc
Set all the fields we can from node.
1 method overrides Notifications_Content_Subscription::set_node()
Notifications_User_Content_Subscription::set_node in notifications_user/notifications_user.inc
Set all the fields we can from node.

File

notifications_content/notifications_content.inc, line 14
Drupal Notifications Framework - Default class file

Class

Notifications_Content_Subscription
Generic content subscription Thread subscription

Code

public function set_node($node) {
  $node_mapping = array(
    'node:nid' => $node->nid,
    'node:type' => $node->type,
    'node:uid' => $node->uid,
  );
  foreach ($node_mapping as $index => $value) {
    if ($field = $this
      ->get_field($index)) {
      $field
        ->set_value($value);
    }
  }
  return $this;
}