You are here

protected function MessageViewBuilder::getBuildDefaults in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/contact/src/MessageViewBuilder.php \Drupal\contact\MessageViewBuilder::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.

Return value

array

Overrides EntityViewBuilder::getBuildDefaults

File

core/modules/contact/src/MessageViewBuilder.php, line 23
Contains \Drupal\contact\MessageViewBuilder.

Class

MessageViewBuilder
Render controller for contact messages.

Namespace

Drupal\contact

Code

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

  // The message fields are individually rendered into email templates, so
  // the entity has no template itself.
  unset($build['#theme']);
  return $build;
}