interface EntityViewDisplayInterface

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php \Drupal\Core\Entity\Display\EntityViewDisplayInterface
  2. 10 core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php \Drupal\Core\Entity\Display\EntityViewDisplayInterface
  3. 8.9.x core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php \Drupal\Core\Entity\Display\EntityViewDisplayInterface

Provides a common interface for entity view displays.

Hierarchy

Expanded class hierarchy of EntityViewDisplayInterface

All classes that implement EntityViewDisplayInterface

41 files declare their use of EntityViewDisplayInterface
AudioFile.php in core/modules/media/src/Plugin/media/Source/AudioFile.php
book.module in core/modules/book/book.module
Allows users to create and organize related content in an outline.
BooleanFormatterTest.php in core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
comment.module in core/modules/comment/comment.module
Enables users to comment on published content.
CommentViewBuilder.php in core/modules/comment/src/CommentViewBuilder.php

... See full list

File

core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php, line 10

Namespace

Drupal\Core\Entity\Display
View source
interface EntityViewDisplayInterface extends EntityDisplayInterface {
  
  /**
   * Builds a renderable array for the components of an entity.
   *
   * See the buildMultiple() method for details.
   *
   * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
   *   The entity being displayed.
   *
   * @return array
   *   A renderable array for the entity.
   *
   * @see \Drupal\Core\Entity\Display\EntityViewDisplayInterface::buildMultiple()
   */
  public function build(FieldableEntityInterface $entity);
  
  /**
   * Builds a renderable array for the components of a set of entities.
   *
   * This only includes the components handled by the Display object, but
   * excludes 'extra fields', that are typically rendered through specific,
   * ad-hoc code in EntityViewBuilderInterface::buildComponents() or in
   * hook_entity_view() implementations.
   *
   * hook_entity_display_build_alter() is invoked on each entity, allowing 3rd
   * party code to alter the render array.
   *
   * @param \Drupal\Core\Entity\FieldableEntityInterface[] $entities
   *   The entities being displayed.
   *
   * @return array
   *   A renderable array for the entities, indexed by the same keys as the
   *   $entities array parameter.
   *
   * @see hook_entity_display_build_alter()
   */
  public function buildMultiple(array $entities);

}

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