function CommentManager::__construct

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

Construct the CommentManager object.

Parameters

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

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

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

\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository service.

File

core/modules/comment/src/CommentManager.php, line 95

Class

CommentManager
Comment manager contains common functions to manage comment fields.

Namespace

Drupal\comment

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory, TranslationInterface $string_translation, ModuleHandlerInterface $module_handler, AccountInterface $current_user, EntityFieldManagerInterface $entity_field_manager, EntityDisplayRepositoryInterface $entity_display_repository) {
    $this->entityTypeManager = $entity_type_manager;
    $this->userConfig = $config_factory->get('user.settings');
    $this->stringTranslation = $string_translation;
    $this->moduleHandler = $module_handler;
    $this->currentUser = $current_user;
    $this->entityFieldManager = $entity_field_manager;
    $this->entityDisplayRepository = $entity_display_repository;
}

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