class AuthcacheCommentNumNewSetting in Authenticated User Page Caching (Authcache) 7.2
Personalization setting for retrieving the number of new comments on a node.
Hierarchy
- class \AuthcacheCommentNumNewSetting implements AuthcacheP13nSettingInterface
Expanded class hierarchy of AuthcacheCommentNumNewSetting
See also
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AuthcacheCommentNumNewSetting:: |
public | function |
Number of new comments for given nids. Overrides AuthcacheP13nSettingInterface:: |