function CommentForm::__construct
Same name in other branches
- 9 core/modules/comment/src/CommentForm.php \Drupal\comment\CommentForm::__construct()
- 10 core/modules/comment/src/CommentForm.php \Drupal\comment\CommentForm::__construct()
- 11.x core/modules/comment/src/CommentForm.php \Drupal\comment\CommentForm::__construct()
Constructs a new CommentForm.
Parameters
\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.
\Drupal\Core\Session\AccountInterface $current_user: The current user.
\Drupal\Core\Render\RendererInterface $renderer: The renderer.
\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.
\Drupal\Component\Datetime\TimeInterface $time: The time service.
Overrides ContentEntityForm::__construct
File
-
core/
modules/ comment/ src/ CommentForm.php, line 78
Class
- CommentForm
- Base handler for comment forms.
Namespace
Drupal\commentCode
public function __construct(EntityRepositoryInterface $entity_repository, AccountInterface $current_user, RendererInterface $renderer, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, EntityFieldManagerInterface $entity_field_manager = NULL) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);
$this->currentUser = $current_user;
$this->renderer = $renderer;
$this->entityFieldManager = $entity_field_manager ?: \Drupal::service('entity_field.manager');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.