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 methods override EntityRenderController::getBuildDefaults()

File

drupal/core/lib/Drupal/Core/Entity/EntityRenderController.php, line 58
Contains \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;
}