You are here

class Notifications_Comment in Notifications 7

Hierarchy

Expanded class hierarchy of Notifications_Comment

1 string reference to 'Notifications_Comment'
notifications_content_notifications in notifications_content/notifications_content.module
Implementation of hook_notifications()

File

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

View source
class Notifications_Comment extends Notifications_Object {
  public $type = 'comment';
  public function get_title() {
    return t('Comment');
  }

  /**
   * Check user access
   */
  function user_access($account) {
    if ($comment = $this
      ->get_object()) {
      return $comment->status == COMMENT_PUBLISHED && user_access('access comments', $account) || user_access('administer comments', $account);
    }
  }

  /**
   * Load related object or data
   */
  public static function object_load($value) {
    return comment_load($value);
  }

  /**
   * Get object name, unfiltered string
   */
  public static function object_name($object) {
    return $comment->title;
  }

  /**
   * Get object key
   */
  public static function object_value($object) {
    return $object->cid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Notifications_Comment::$type public property
Notifications_Comment::get_title public function
Notifications_Comment::object_load public static function Load related object or data
Notifications_Comment::object_name public static function Get object name, unfiltered string
Notifications_Comment::object_value public static function Get object key
Notifications_Comment::user_access function Check user access