You are here

public function CommentLinkBuilder::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/src/CommentLinkBuilder.php \Drupal\comment\CommentLinkBuilder::__construct()
  2. 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;
}