function CommentHooks::cron
Same name and namespace in other branches
- 11.x core/modules/comment/src/Hook/CommentHooks.php \Drupal\comment\Hook\CommentHooks::cron()
Implements hook_cron().
Attributes
File
-
core/
modules/ comment/ src/ Hook/ CommentHooks.php, line 331
Class
- CommentHooks
- Hook implementations for comment.
Namespace
Drupal\comment\HookCode
public function cron() : void {
// Store the maximum possible comments per thread (used for node search
// ranking by reply count).
\Drupal::state()->set('comment.node_comment_statistics_scale', 1.0 / max(1, \Drupal::service('comment.statistics')->getMaximumCount('node')));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.