function CommentController::__construct

Same name in other branches
  1. 8.9.x core/modules/comment/src/Controller/CommentController.php \Drupal\comment\Controller\CommentController::__construct()
  2. 10 core/modules/comment/src/Controller/CommentController.php \Drupal\comment\Controller\CommentController::__construct()
  3. 11.x core/modules/comment/src/Controller/CommentController.php \Drupal\comment\Controller\CommentController::__construct()

Constructs a CommentController object.

Parameters

\Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel: HTTP kernel to handle requests.

\Drupal\comment\CommentManagerInterface $comment_manager: The comment manager service.

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

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager service.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository service.

File

core/modules/comment/src/Controller/CommentController.php, line 73

Class

CommentController
Controller for the comment entity.

Namespace

Drupal\comment\Controller

Code

public function __construct(HttpKernelInterface $http_kernel, CommentManagerInterface $comment_manager, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, EntityRepositoryInterface $entity_repository) {
    $this->httpKernel = $http_kernel;
    $this->commentManager = $comment_manager;
    $this->entityTypeManager = $entity_type_manager;
    $this->entityFieldManager = $entity_field_manager;
    $this->entityRepository = $entity_repository;
}

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