function NodeStatisticsDatabaseStorage::__construct

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

Constructs the statistics storage.

Parameters

\Drupal\Core\Database\Connection $connection: The database connection for the node view storage.

\Drupal\Core\State\StateInterface $state: The state service.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

File

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

Class

NodeStatisticsDatabaseStorage
Provides the default database storage backend for statistics.

Namespace

Drupal\statistics

Code

public function __construct(Connection $connection, StateInterface $state, RequestStack $request_stack) {
    $this->connection = $connection;
    $this->state = $state;
    $this->requestStack = $request_stack;
}

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