function MessageViewBuilder::getBuildDefaults

Same name in other branches
  1. 9 core/modules/contact/src/MessageViewBuilder.php \Drupal\contact\MessageViewBuilder::getBuildDefaults()
  2. 8.9.x core/modules/contact/src/MessageViewBuilder.php \Drupal\contact\MessageViewBuilder::getBuildDefaults()
  3. 11.x core/modules/contact/src/MessageViewBuilder.php \Drupal\contact\MessageViewBuilder::getBuildDefaults()

Overrides EntityViewBuilder::getBuildDefaults

File

core/modules/contact/src/MessageViewBuilder.php, line 17

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.