You are here

public function CommentForm::__construct in Drupal 10

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

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

Overrides ContentEntityForm::__construct

File

core/modules/comment/src/CommentForm.php, line 80

Class

CommentForm
Base handler for comment forms.

Namespace

Drupal\comment

Code

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');
}