function EntityViewBuilder::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()
  2. 10 core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()
  3. 9 core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()
  4. 8.9.x core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()

Constructs a new EntityViewBuilder.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

\Drupal\Core\Entity\EntityRepositoryInterface $entityRepository: The entity repository service.

\Drupal\Core\Language\LanguageManagerInterface $languageManager: The language manager.

\Drupal\Core\Theme\Registry $themeRegistry: The theme registry.

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

1 call to EntityViewBuilder::__construct()
CommentViewBuilder::__construct in core/modules/comment/src/CommentViewBuilder.php
Constructs a new CommentViewBuilder.
1 method overrides EntityViewBuilder::__construct()
CommentViewBuilder::__construct in core/modules/comment/src/CommentViewBuilder.php
Constructs a new CommentViewBuilder.

File

core/lib/Drupal/Core/Entity/EntityViewBuilder.php, line 76

Class

EntityViewBuilder
Base class for entity view builders.

Namespace

Drupal\Core\Entity

Code

public function __construct(EntityTypeInterface $entity_type, protected EntityRepositoryInterface $entityRepository, protected LanguageManagerInterface $languageManager, protected Registry $themeRegistry, protected EntityDisplayRepositoryInterface $entityDisplayRepository) {
  $this->entityTypeId = $entity_type->id();
  $this->entityType = $entity_type;
}

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