You are here

class Notifications_Node_Event in Notifications 7

Node events

Hierarchy

Expanded class hierarchy of Notifications_Node_Event

File

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

View source
class Notifications_Node_Event extends Notifications_Event {

  /**
   * Set main object id when node is added to the event
   */
  public function set_object($object) {
    if ($object->type == 'node') {
      $this->oid = $object
        ->get_value();
    }
    return parent::set_object($object);
  }

  /**
   * Get node object
   */
  public function get_node() {
    return $this
      ->get_object('node')
      ->get_object();
  }

  /**
   * Trigger node event
   */
  public function trigger() {
    $node = $this
      ->get_node();
    if ($result = parent::trigger()) {
      watchdog('action', 'Triggered notifications for  @type %title..', array(
        '@type' => node_type_get_name($node),
        '%title' => $node->title,
      ));
    }
    return $result;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Notifications_Node_Event::get_node public function Get node object
Notifications_Node_Event::set_object public function Set main object id when node is added to the event
Notifications_Node_Event::trigger public function Trigger node event