3 namespace Drupal\Core\Entity;
6 * Provides an interface for an entity display repository.
8 interface EntityDisplayRepositoryInterface {
11 * Gets the entity view mode info for all entity types.
14 * The view mode info for all entity types.
16 public function getAllViewModes();
19 * Gets the entity view mode info for a specific entity type.
21 * @param string $entity_type_id
22 * The entity type whose view mode info should be returned.
25 * The view mode info for a specific entity type.
27 public function getViewModes($entity_type_id);
30 * Gets the entity form mode info for all entity types.
33 * The form mode info for all entity types.
35 public function getAllFormModes();
38 * Gets the entity form mode info for a specific entity type.
40 * @param string $entity_type_id
41 * The entity type whose form mode info should be returned.
44 * The form mode info for a specific entity type.
46 public function getFormModes($entity_type_id);
49 * Gets an array of view mode options.
51 * @param string $entity_type_id
52 * The entity type whose view mode options should be returned.
55 * An array of view mode labels, keyed by the display mode ID.
57 public function getViewModeOptions($entity_type_id);
60 * Gets an array of form mode options.
62 * @param string $entity_type_id
63 * The entity type whose form mode options should be returned.
66 * An array of form mode labels, keyed by the display mode ID.
68 public function getFormModeOptions($entity_type_id);
71 * Returns an array of enabled view mode options by bundle.
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.
79 * An array of view mode labels, keyed by the display mode ID.
81 public function getViewModeOptionsByBundle($entity_type_id, $bundle);
84 * Returns an array of enabled form mode options by bundle.
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.
92 * An array of form mode labels, keyed by the display mode ID.
94 public function getFormModeOptionsByBundle($entity_type_id, $bundle);
97 * Clears the gathered display mode info.
101 public function clearDisplayModeInfo();