function NodeStatisticsDatabaseStorage::maxTotalCount

Same name in other branches
  1. 9 core/modules/statistics/src/NodeStatisticsDatabaseStorage.php \Drupal\statistics\NodeStatisticsDatabaseStorage::maxTotalCount()
  2. 8.9.x core/modules/statistics/src/NodeStatisticsDatabaseStorage.php \Drupal\statistics\NodeStatisticsDatabaseStorage::maxTotalCount()
  3. 11.x core/modules/statistics/src/NodeStatisticsDatabaseStorage.php \Drupal\statistics\NodeStatisticsDatabaseStorage::maxTotalCount()

File

core/modules/statistics/src/NodeStatisticsDatabaseStorage.php, line 135

Class

NodeStatisticsDatabaseStorage
Provides the default database storage backend for statistics.

Namespace

Drupal\statistics

Code

public function maxTotalCount() {
    $query = $this->connection
        ->select('node_counter', 'nc');
    $query->addExpression('MAX([totalcount])');
    $max_total_count = (int) $query->execute()
        ->fetchField();
    return $max_total_count;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.