function EntityViewBuilder::createInstance

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

Overrides EntityHandlerInterface::createInstance

1 call to EntityViewBuilder::createInstance()
WorkspaceViewBuilder::createInstance in core/modules/workspaces/src/WorkspaceViewBuilder.php
Instantiates a new instance of this entity handler.
2 methods override EntityViewBuilder::createInstance()
CommentViewBuilder::createInstance in core/modules/comment/src/CommentViewBuilder.php
Instantiates a new instance of this entity handler.
WorkspaceViewBuilder::createInstance in core/modules/workspaces/src/WorkspaceViewBuilder.php
Instantiates a new instance of this entity handler.

File

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

Class

EntityViewBuilder
Base class for entity view builders.

Namespace

Drupal\Core\Entity

Code

public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
    return new static($entity_type, $container->get('entity.repository'), $container->get('language_manager'), $container->get('theme.registry'), $container->get('entity_display.repository'));
}

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