MessageViewBuilder::getBuildDefaults

protected MessageViewBuilder::getBuildDefaults(EntityInterface $entity, $view_mode)

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 18

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;
}
doc_Drupal
2016-10-29 09:28:19
Comments
Leave a Comment

Please login to continue.