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