function EntityViewBuilder::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityViewBuilder.php \Drupal\Core\Entity\EntityViewBuilder::__construct()
  3. 11.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 $entity_repository: The entity repository service.

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

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

\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: 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 97

Class

EntityViewBuilder
Base class for entity view builders.

Namespace

Drupal\Core\Entity

Code

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

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