3 namespace Drupal\Core\Entity\Display;
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6 use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
9 * Provides a common interface for entity displays.
11 interface EntityDisplayInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface {
14 * Creates a duplicate of the entity display object on a different view mode.
16 * The new object necessarily has the same $targetEntityType and $bundle
17 * properties than the original one.
19 * @param string $view_mode
20 * The view mode for the new object.
23 * A duplicate of this object with the given view mode.
25 public function createCopy($view_mode);
28 * Gets the display options for all components.
31 * The array of display options, keyed by component name.
33 public function getComponents();
36 * Gets the display options set for a component.
39 * The name of the component.
42 * The display options for the component, or NULL if the component is not
45 public function getComponent($name);
48 * Sets the display options for a component.
51 * The name of the component.
52 * @param array $options
53 * The display options.
57 public function setComponent($name, array $options = []);
60 * Sets a component to be hidden.
63 * The name of the component.
67 public function removeComponent($name);
70 * Gets the highest weight of the components in the display.
73 * The highest weight of the components in the display, or NULL if the
76 public function getHighestWeight();
79 * Gets the renderer plugin for a field (e.g. widget, formatter).
81 * @param string $field_name
84 * @return \Drupal\Core\Field\PluginSettingsInterface|null
85 * A widget or formatter plugin or NULL if the field does not exist.
87 public function getRenderer($field_name);
90 * Gets the entity type for which this display is used.
95 public function getTargetEntityTypeId();
98 * Gets the view or form mode to be displayed.
101 * The mode to be displayed.
103 public function getMode();
106 * Gets the original view or form mode that was requested.
109 * The original mode that was requested.
111 public function getOriginalMode();
114 * Gets the bundle to be displayed.
117 * The bundle to be displayed.
119 public function getTargetBundle();
122 * Sets the bundle to be displayed.
124 * @param string $bundle
125 * The bundle to be displayed.
129 public function setTargetBundle($bundle);