function ForumManager::__construct

Same name in other branches
  1. 9 core/modules/forum/src/ForumManager.php \Drupal\forum\ForumManager::__construct()
  2. 10 core/modules/forum/src/ForumManager.php \Drupal\forum\ForumManager::__construct()
  3. 11.x core/modules/forum/src/ForumManager.php \Drupal\forum\ForumManager::__construct()

Constructs the forum manager service.

Parameters

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

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

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

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

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

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

File

core/modules/forum/src/ForumManager.php, line 139

Class

ForumManager
Provides forum manager service.

Namespace

Drupal\forum

Code

public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, Connection $connection, TranslationInterface $string_translation, CommentManagerInterface $comment_manager, EntityFieldManagerInterface $entity_field_manager = NULL) {
    $this->configFactory = $config_factory;
    $this->entityTypeManager = $entity_type_manager;
    $this->connection = $connection;
    $this->stringTranslation = $string_translation;
    $this->commentManager = $comment_manager;
    if (!$entity_field_manager) {
        @trigger_error('The entity_field.manager service must be passed to ForumManager::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
        $entity_field_manager = \Drupal::service('entity_field.manager');
    }
    $this->entityFieldManager = $entity_field_manager;
}

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