protected function EntityRenderController::getBuildDefaults

Provides entity-specific defaults to the build process.

Parameters

Drupal\Core\Entity\EntityInterface $entity: The entity for which the defaults should be provided.

string $view_mode: The view mode that should be used.

string $langcode: (optional) For which language the entity should be prepared, defaults to the current content language.

Return value

array

3 calls to EntityRenderController::getBuildDefaults()
EntityRenderController::viewMultiple in drupal/core/lib/Drupal/Core/Entity/EntityRenderController.php
Implements Drupal\Core\Entity\EntityRenderControllerInterface::viewMultiple().
TermRenderController::getBuildDefaults in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php
Provides entity-specific defaults to the build process.
UserRenderController::getBuildDefaults in drupal/core/modules/user/lib/Drupal/user/UserRenderController.php
Overrides Drupal\Core\Entity\EntityRenderController::getBuildDefaults().
2 methods override EntityRenderController::getBuildDefaults()
TermRenderController::getBuildDefaults in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php
Provides entity-specific defaults to the build process.
UserRenderController::getBuildDefaults in drupal/core/modules/user/lib/Drupal/user/UserRenderController.php
Overrides Drupal\Core\Entity\EntityRenderController::getBuildDefaults().

File

drupal/core/lib/Drupal/Core/Entity/EntityRenderController.php, line 81
Definition of Drupal\Core\Entity\EntityRenderController.

Class

EntityRenderController
Base class for entity view controllers.

Namespace

Drupal\Core\Entity

Code

protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) {
  $return = array(
    '#theme' => $this->entityType,
    "#{$this->entityType}" => $entity,
    '#view_mode' => $view_mode,
    '#langcode' => $langcode,
  );
  return $return;
}