Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / Display / EntityViewDisplayInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity\Display;
4
5 use Drupal\Core\Entity\FieldableEntityInterface;
6
7 /**
8  * Provides a common interface for entity view displays.
9  */
10 interface EntityViewDisplayInterface extends EntityDisplayInterface {
11
12   /**
13    * Builds a renderable array for the components of an entity.
14    *
15    * See the buildMultiple() method for details.
16    *
17    * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
18    *   The entity being displayed.
19    *
20    * @return array
21    *   A renderable array for the entity.
22    *
23    * @see \Drupal\Core\Entity\Display\EntityViewDisplayInterface::buildMultiple()
24    */
25   public function build(FieldableEntityInterface $entity);
26
27   /**
28    * Builds a renderable array for the components of a set of entities.
29    *
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.
34    *
35    * hook_entity_display_build_alter() is invoked on each entity, allowing 3rd
36    * party code to alter the render array.
37    *
38    * @param \Drupal\Core\Entity\FieldableEntityInterface[] $entities
39    *   The entities being displayed.
40    *
41    * @return array
42    *   A renderable array for the entities, indexed by the same keys as the
43    *   $entities array parameter.
44    *
45    * @see hook_entity_display_build_alter()
46    */
47   public function buildMultiple(array $entities);
48
49 }