You are here

protected function ContactMessageViewBuilder::getBuildDefaults in Contact Storage 8

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/ContactMessageViewBuilder.php, line 19

Class

ContactMessageViewBuilder
Customized contact message view that does not do HTML to plain conversion.

Namespace

Drupal\contact_storage

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.
  // @todo  Remove this when providing a template in
  // https://www.drupal.org/node/2722501.
  unset($build['#theme']);
  return $build;
}