You are here

protected function CiviCrmEntityViewBuilder::getBuildDefaults in CiviCRM Entity 8.3

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.

Return value

array

Overrides EntityViewBuilder::getBuildDefaults

File

src/CiviCrmEntityViewBuilder.php, line 13

Class

CiviCrmEntityViewBuilder

Namespace

Drupal\civicrm_entity

Code

protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
  $defaults = parent::getBuildDefaults($entity, $view_mode);

  // Set a default theme.
  $defaults['#theme'] = 'civicrm_entity';
  return $defaults;
}