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

Breadcrumb

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

function CommentStatistics::__construct

Constructs the CommentStatistics service.

Parameters

\Drupal\Core\Database\Connection $database: The active database connection.

\Drupal\Core\Session\AccountInterface $current_user: The current logged in user.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

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

\Drupal\Component\Datetime\TimeInterface $time: The time service.

\Drupal\Core\Database\Connection|null $database_replica: (Optional) the replica database connection.

File

core/modules/comment/src/CommentStatistics.php, line 68

Class

CommentStatistics

Namespace

Drupal\comment

Code

public function __construct(Connection $database, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, TimeInterface $time, ?Connection $database_replica = NULL) {
    $this->database = $database;
    $this->currentUser = $current_user;
    $this->entityTypeManager = $entity_type_manager;
    $this->state = $state;
    $this->databaseReplica = $database_replica ?: $database;
}
RSS feed
Powered by Drupal