public function ForumManager::__construct in Drupal 8
Same name and namespace in other branches
- 9 core/modules/forum/src/ForumManager.php \Drupal\forum\ForumManager::__construct()
- 10 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\forumCode
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;
}