3 namespace Drupal\Core\Entity\Display;
5 use Drupal\Core\Entity\FieldableEntityInterface;
8 * Provides a common interface for entity view displays.
10 interface EntityViewDisplayInterface extends EntityDisplayInterface {
13 * Builds a renderable array for the components of an entity.
15 * See the buildMultiple() method for details.
17 * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
18 * The entity being displayed.
21 * A renderable array for the entity.
23 * @see \Drupal\Core\Entity\Display\EntityViewDisplayInterface::buildMultiple()
25 public function build(FieldableEntityInterface $entity);
28 * Builds a renderable array for the components of a set of entities.
30 * This only includes the components handled by the Display object, but
31 * excludes 'extra fields', that are typically rendered through specific,
32 * ad-hoc code in EntityViewBuilderInterface::buildComponents() or in
33 * hook_entity_view() implementations.
35 * hook_entity_display_build_alter() is invoked on each entity, allowing 3rd
36 * party code to alter the render array.
38 * @param \Drupal\Core\Entity\FieldableEntityInterface[] $entities
39 * The entities being displayed.
42 * A renderable array for the entities, indexed by the same keys as the
43 * $entities array parameter.
45 * @see hook_entity_display_build_alter()
47 public function buildMultiple(array $entities);