function CommentLinkBuilder::__construct

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

Constructs a new CommentLinkBuilder object.

Parameters

\Drupal\Core\Session\AccountInterface $current_user: Current user.

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

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: Module handler service.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: String translation service.

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

File

core/modules/comment/src/CommentLinkBuilder.php, line 66

Class

CommentLinkBuilder
Defines a class for building markup for comment links on a commented entity.

Namespace

Drupal\comment

Code

public function __construct(AccountInterface $current_user, CommentManagerInterface $comment_manager, ModuleHandlerInterface $module_handler, TranslationInterface $string_translation, EntityTypeManagerInterface $entity_type_manager) {
    $this->currentUser = $current_user;
    $this->commentManager = $comment_manager;
    $this->moduleHandler = $module_handler;
    $this->stringTranslation = $string_translation;
    $this->entityTypeManager = $entity_type_manager;
}

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