1 | <?php |
||
57 | class EntityBrowser extends ConfigEntityBase implements EntityBrowserInterface, EntityWithPluginCollectionInterface { |
||
58 | |||
59 | /** |
||
60 | * The name of the entity browser. |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | public $name; |
||
65 | |||
66 | /** |
||
67 | * The entity browser label. |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | public $label; |
||
72 | |||
73 | /** |
||
74 | * The display plugin id. |
||
75 | * |
||
76 | * @var string |
||
77 | */ |
||
78 | public $display; |
||
79 | |||
80 | /** |
||
81 | * The display plugin configuration. |
||
82 | * |
||
83 | * @var array |
||
84 | */ |
||
85 | public $display_configuration = []; |
||
86 | |||
87 | /** |
||
88 | * Display lazy plugin collection. |
||
89 | * |
||
90 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
91 | */ |
||
92 | protected $displayCollection; |
||
93 | |||
94 | /** |
||
95 | * The array of widgets for this entity browser. |
||
96 | * |
||
97 | * @var array |
||
98 | */ |
||
99 | protected $widgets = []; |
||
100 | |||
101 | /** |
||
102 | * Holds the collection of widgets that are used by this entity browser. |
||
103 | * |
||
104 | * @var \Drupal\entity_browser\WidgetsCollection |
||
105 | */ |
||
106 | protected $widgetsCollection; |
||
107 | |||
108 | /** |
||
109 | * The selection display plugin ID. |
||
110 | * |
||
111 | * @var string |
||
112 | */ |
||
113 | public $selection_display; |
||
114 | |||
115 | /** |
||
116 | * The selection display plugin configuration. |
||
117 | * |
||
118 | * @var array |
||
119 | */ |
||
120 | public $selection_display_configuration = []; |
||
121 | |||
122 | /** |
||
123 | * Selection display plugin collection. |
||
124 | * |
||
125 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
126 | */ |
||
127 | protected $selectionDisplayCollection; |
||
128 | |||
129 | /** |
||
130 | * The widget selector plugin ID. |
||
131 | * |
||
132 | * @var string |
||
133 | */ |
||
134 | public $widget_selector; |
||
135 | |||
136 | /** |
||
137 | * The widget selector plugin configuration. |
||
138 | * |
||
139 | * @var array |
||
140 | */ |
||
141 | public $widget_selector_configuration = []; |
||
142 | |||
143 | /** |
||
144 | * Widget selector plugin collection. |
||
145 | * |
||
146 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
147 | */ |
||
148 | protected $widgetSelectorCollection; |
||
149 | |||
150 | /** |
||
151 | * Additional widget parameters. |
||
152 | * |
||
153 | * @var array |
||
154 | */ |
||
155 | protected $additional_widget_parameters = []; |
||
156 | |||
157 | /** |
||
158 | * Name of the form class. |
||
159 | * |
||
160 | * @var string |
||
161 | */ |
||
162 | protected $form_class = '\Drupal\entity_browser\Form\EntityBrowserForm'; |
||
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | public function id() { |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function getName() { |
||
177 | |||
178 | /** |
||
179 | * {@inheritdoc} |
||
180 | */ |
||
181 | public function setName($name) { |
||
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | public function getDisplay() { |
||
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | public function setLabel($label) { |
||
200 | |||
201 | /** |
||
202 | * {@inheritdoc} |
||
203 | */ |
||
204 | public function setDisplay($display) { |
||
210 | |||
211 | /** |
||
212 | * {@inheritdoc} |
||
213 | */ |
||
214 | public function setWidgetSelector($widget_selector) { |
||
220 | |||
221 | /** |
||
222 | * {@inheritdoc} |
||
223 | */ |
||
224 | public function setSelectionDisplay($selection_display) { |
||
230 | |||
231 | /** |
||
232 | * Returns display plugin collection. |
||
233 | * |
||
234 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
235 | * The tag plugin collection. |
||
236 | */ |
||
237 | protected function displayPluginCollection() { |
||
244 | |||
245 | /** |
||
246 | * Returns the plugin collections used by this entity. |
||
247 | * |
||
248 | * @return \Drupal\Component\Plugin\LazyPluginCollection[] |
||
249 | * An array of plugin collections, keyed by the property name they use to |
||
250 | * store their configuration. |
||
251 | */ |
||
252 | public function getPluginCollections() { |
||
260 | |||
261 | /** |
||
262 | * {@inheritdoc} |
||
263 | */ |
||
264 | public function getWidget($widget) { |
||
267 | |||
268 | /** |
||
269 | * {@inheritdoc} |
||
270 | */ |
||
271 | public function getWidgets() { |
||
281 | |||
282 | /** |
||
283 | * {@inheritdoc} |
||
284 | */ |
||
285 | public function addWidget(array $configuration) { |
||
290 | |||
291 | /** |
||
292 | * {@inheritdoc} |
||
293 | */ |
||
294 | public function deleteWidget(WidgetInterface $widget) { |
||
299 | |||
300 | /** |
||
301 | * {@inheritdoc} |
||
302 | */ |
||
303 | public function getFirstWidget() { |
||
307 | |||
308 | /** |
||
309 | * {@inheritdoc} |
||
310 | */ |
||
311 | public function addAdditionalWidgetParameters(array $parameters) { |
||
316 | |||
317 | /** |
||
318 | * {@inheritdoc} |
||
319 | */ |
||
320 | public function getAdditionalWidgetParameters() { |
||
324 | |||
325 | /** |
||
326 | * Returns selection display plugin collection. |
||
327 | * |
||
328 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
329 | * The tag plugin collection. |
||
330 | */ |
||
331 | protected function selectionDisplayPluginCollection() { |
||
338 | |||
339 | /** |
||
340 | * {@inheritdoc} |
||
341 | */ |
||
342 | public function getSelectionDisplay() { |
||
345 | |||
346 | /** |
||
347 | * Returns widget selector plugin collection. |
||
348 | * |
||
349 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
350 | * The tag plugin collection. |
||
351 | */ |
||
352 | protected function widgetSelectorPluginCollection() { |
||
363 | |||
364 | /** |
||
365 | * {@inheritdoc} |
||
366 | */ |
||
367 | public function getWidgetSelector() { |
||
370 | |||
371 | /** |
||
372 | * {@inheritdoc} |
||
373 | */ |
||
374 | public function route() { |
||
394 | |||
395 | /** |
||
396 | * {@inheritdoc} |
||
397 | */ |
||
398 | public function preSave(EntityStorageInterface $storage) { |
||
410 | |||
411 | /** |
||
412 | * Prevent plugin collections from being serialized and correctly serialize |
||
413 | * selected entities. |
||
414 | */ |
||
415 | public function __sleep() { |
||
433 | |||
434 | /** |
||
435 | * {@inheritdoc} |
||
436 | */ |
||
437 | public function save() { |
||
444 | |||
445 | /** |
||
446 | * {@inheritdoc} |
||
447 | */ |
||
448 | public function getFormObject() { |
||
453 | |||
454 | } |
||
455 |