3 namespace Drupal\entity_browser;
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
8 * Provides an interface defining an entity browser entity.
10 interface EntityBrowserInterface extends ConfigEntityInterface {
13 * Gets the entity browser name.
16 * The name of the entity browser.
18 public function getName();
21 * Sets the name of the entity browser.
24 * The name of the entity browser.
26 * @return \Drupal\entity_browser\EntityBrowserInterface
27 * The class instance this method is called on.
29 public function setName($name);
32 * Sets the label of the entity browser.
34 * @param string $label
35 * The label of the entity browser.
37 * @return \Drupal\entity_browser\EntityBrowserInterface
38 * The class instance this method is called on.
40 public function setLabel($label);
43 * Sets the id of the display plugin.
45 * @param string $display
46 * The id of the display plugin.
48 * @return \Drupal\entity_browser\EntityBrowserInterface
49 * The class instance this method is called on.
51 public function setDisplay($display);
54 * Sets the id of the widget selector plugin.
56 * @param string $display
57 * The id of the widget selector plugin.
59 * @return \Drupal\entity_browser\EntityBrowserInterface
60 * The class instance this method is called on.
62 public function setWidgetSelector($widget_selector);
65 * Sets the id of the selection display plugin.
67 * @param string $display
68 * The id of the selection display plugin.
70 * @return \Drupal\entity_browser\EntityBrowserInterface
71 * The class instance this method is called on.
73 public function setSelectionDisplay($selection_display);
76 * Returns the display.
78 * @return \Drupal\entity_browser\DisplayInterface
81 public function getDisplay();
84 * Returns a specific widget.
86 * @param string $widget
89 * @return \Drupal\entity_browser\WidgetInterface
92 public function getWidget($widget);
95 * Returns the widgets for this entity browser.
97 * @return \Drupal\entity_browser\WidgetsLazyPluginCollection
100 public function getWidgets();
103 * Saves a widget for this entity browser.
105 * @param array $configuration
106 * An array of widget configuration.
111 public function addWidget(array $configuration);
114 * Deletes a widget from this entity browser.
116 * @param \Drupal\entity_browser\WidgetInterface $widget
121 public function deleteWidget(WidgetInterface $widget);
124 * Gets first widget based on weights.
126 * @return string|null
127 * First widget instance ID or NULL if no widgets are available.
129 public function getFirstWidget();
132 * Adds paramterers that will be passed to the widget.
134 * @param array $parameters
135 * An array of parameters.
139 public function addAdditionalWidgetParameters(array $parameters);
142 * Gets additional parameters that will be passed to the widget.
145 * Array of parameters.
147 public function getAdditionalWidgetParameters();
150 * Returns the selection display.
152 * @return \Drupal\entity_browser\SelectionDisplayInterface
155 public function getSelectionDisplay();
158 * Returns the widget selector.
160 * @return \Drupal\entity_browser\WidgetSelectorInterface
161 * The widget selector.
163 public function getWidgetSelector();
166 * Gets route that matches this display.
168 * @return \Symfony\Component\Routing\Route|bool
169 * Route object or FALSE if no route is used.
171 public function route();
174 * Gets entity browser form object.
176 * @return \Drupal\entity_browser\EntityBrowserFormInterface
177 * Entity browser form.
179 public function getFormObject();