You are here

class AuthcacheCommentNumNewSetting in Authenticated User Page Caching (Authcache) 7.2

Personalization setting for retrieving the number of new comments on a node.

Hierarchy

Expanded class hierarchy of AuthcacheCommentNumNewSetting

See also

node.module

1 string reference to 'AuthcacheCommentNumNewSetting'
authcache_comment_authcache_p13n_setting in modules/authcache_comment/authcache_comment.module
Implements hook_authcache_p13n_setting().

File

modules/authcache_comment/includes/AuthcacheCommentNumNewSetting.inc, line 13
Defines a personalization setting for retrieving the number of new comments on a node.

View source
class AuthcacheCommentNumNewSetting implements AuthcacheP13nSettingInterface {

  /**
   * Number of new comments for given nids.
   */
  public function get($params, $context) {
    include_once DRUPAL_ROOT . '/modules/node/node.module';
    include_once DRUPAL_ROOT . '/modules/comment/comment.module';
    $result = array();
    foreach ($params as $nid) {
      $result[$nid] = (int) comment_num_new($nid);
    }
    return array_filter($result);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthcacheCommentNumNewSetting::get public function Number of new comments for given nids. Overrides AuthcacheP13nSettingInterface::get