Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityDisplayRepositoryInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Provides an interface for an entity display repository.
7  */
8 interface EntityDisplayRepositoryInterface {
9
10   /**
11    * Gets the entity view mode info for all entity types.
12    *
13    * @return array
14    *   The view mode info for all entity types.
15    */
16   public function getAllViewModes();
17
18   /**
19    * Gets the entity view mode info for a specific entity type.
20    *
21    * @param string $entity_type_id
22    *   The entity type whose view mode info should be returned.
23    *
24    * @return array
25    *   The view mode info for a specific entity type.
26    */
27   public function getViewModes($entity_type_id);
28
29   /**
30    * Gets the entity form mode info for all entity types.
31    *
32    * @return array
33    *   The form mode info for all entity types.
34    */
35   public function getAllFormModes();
36
37   /**
38    * Gets the entity form mode info for a specific entity type.
39    *
40    * @param string $entity_type_id
41    *   The entity type whose form mode info should be returned.
42    *
43    * @return array
44    *   The form mode info for a specific entity type.
45    */
46   public function getFormModes($entity_type_id);
47
48   /**
49    * Gets an array of view mode options.
50    *
51    * @param string $entity_type_id
52    *   The entity type whose view mode options should be returned.
53    *
54    * @return array
55    *   An array of view mode labels, keyed by the display mode ID.
56    */
57   public function getViewModeOptions($entity_type_id);
58
59   /**
60    * Gets an array of form mode options.
61    *
62    * @param string $entity_type_id
63    *   The entity type whose form mode options should be returned.
64    *
65    * @return array
66    *   An array of form mode labels, keyed by the display mode ID.
67    */
68   public function getFormModeOptions($entity_type_id);
69
70   /**
71    * Returns an array of enabled view mode options by bundle.
72    *
73    * @param string $entity_type_id
74    *   The entity type whose view mode options should be returned.
75    * @param string $bundle
76    *   The name of the bundle.
77    *
78    * @return array
79    *   An array of view mode labels, keyed by the display mode ID.
80    */
81   public function getViewModeOptionsByBundle($entity_type_id, $bundle);
82
83   /**
84    * Returns an array of enabled form mode options by bundle.
85    *
86    * @param string $entity_type_id
87    *   The entity type whose form mode options should be returned.
88    * @param string $bundle
89    *   The name of the bundle.
90    *
91    * @return array
92    *   An array of form mode labels, keyed by the display mode ID.
93    */
94   public function getFormModeOptionsByBundle($entity_type_id, $bundle);
95
96   /**
97    * Clears the gathered display mode info.
98    *
99    * @return $this
100    */
101   public function clearDisplayModeInfo();
102
103 }