Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommentHooks.php

function CommentHooks::cron

Implements hook_cron().

File

core/modules/comment/src/Hook/CommentHooks.php, line 384

Class

CommentHooks
Hook implementations for comment.

Namespace

Drupal\comment\Hook

Code

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')));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal