1 | <?php |
||
63 | class EntityBrowser extends ConfigEntityBase implements EntityBrowserInterface, EntityWithPluginCollectionInterface { |
||
64 | |||
65 | /** |
||
66 | * The name of the entity browser. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | public $name; |
||
71 | |||
72 | /** |
||
73 | * The entity browser label. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | public $label; |
||
78 | |||
79 | /** |
||
80 | * The display plugin id. |
||
81 | * |
||
82 | * @var string |
||
83 | */ |
||
84 | public $display; |
||
85 | |||
86 | /** |
||
87 | * The display plugin configuration. |
||
88 | * |
||
89 | * @var array |
||
90 | */ |
||
91 | public $display_configuration = []; |
||
92 | |||
93 | /** |
||
94 | * Display lazy plugin collection. |
||
95 | * |
||
96 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
97 | */ |
||
98 | protected $displayCollection; |
||
99 | |||
100 | /** |
||
101 | * The array of widgets for this entity browser. |
||
102 | * |
||
103 | * @var array |
||
104 | */ |
||
105 | protected $widgets = []; |
||
106 | |||
107 | /** |
||
108 | * Holds the collection of widgets that are used by this entity browser. |
||
109 | * |
||
110 | * @var \Drupal\entity_browser\WidgetsCollection |
||
111 | */ |
||
112 | protected $widgetsCollection; |
||
113 | |||
114 | /** |
||
115 | * The selection display plugin ID. |
||
116 | * |
||
117 | * @var string |
||
118 | */ |
||
119 | public $selection_display; |
||
120 | |||
121 | /** |
||
122 | * The selection display plugin configuration. |
||
123 | * |
||
124 | * @var array |
||
125 | */ |
||
126 | public $selection_display_configuration = []; |
||
127 | |||
128 | /** |
||
129 | * Selection display plugin collection. |
||
130 | * |
||
131 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
132 | */ |
||
133 | protected $selectionDisplayCollection; |
||
134 | |||
135 | /** |
||
136 | * The widget selector plugin ID. |
||
137 | * |
||
138 | * @var string |
||
139 | */ |
||
140 | public $widget_selector; |
||
141 | |||
142 | /** |
||
143 | * The widget selector plugin configuration. |
||
144 | * |
||
145 | * @var array |
||
146 | */ |
||
147 | public $widget_selector_configuration = []; |
||
148 | |||
149 | /** |
||
150 | * Widget selector plugin collection. |
||
151 | * |
||
152 | * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
153 | */ |
||
154 | protected $widgetSelectorCollection; |
||
155 | |||
156 | /** |
||
157 | * Additional widget parameters. |
||
158 | * |
||
159 | * @var array |
||
160 | */ |
||
161 | protected $additional_widget_parameters = []; |
||
162 | |||
163 | /** |
||
164 | * Name of the form class. |
||
165 | * |
||
166 | * @var string |
||
167 | */ |
||
168 | protected $form_class = '\Drupal\entity_browser\Form\EntityBrowserForm'; |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | public function id() { |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | public function getName() { |
||
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | */ |
||
187 | public function setName($name) { |
||
191 | |||
192 | /** |
||
193 | * {@inheritdoc} |
||
194 | */ |
||
195 | public function getDisplay() { |
||
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | public function setLabel($label) { |
||
206 | |||
207 | /** |
||
208 | * {@inheritdoc} |
||
209 | */ |
||
210 | public function setDisplay($display) { |
||
216 | |||
217 | /** |
||
218 | * {@inheritdoc} |
||
219 | */ |
||
220 | public function setWidgetSelector($widget_selector) { |
||
226 | |||
227 | /** |
||
228 | * {@inheritdoc} |
||
229 | */ |
||
230 | public function setSelectionDisplay($selection_display) { |
||
236 | |||
237 | /** |
||
238 | * Returns display plugin collection. |
||
239 | * |
||
240 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
241 | * The tag plugin collection. |
||
242 | */ |
||
243 | protected function displayPluginCollection() { |
||
250 | |||
251 | /** |
||
252 | * Returns the plugin collections used by this entity. |
||
253 | * |
||
254 | * @return \Drupal\Component\Plugin\LazyPluginCollection[] |
||
255 | * An array of plugin collections, keyed by the property name they use to |
||
256 | * store their configuration. |
||
257 | */ |
||
258 | public function getPluginCollections() { |
||
266 | |||
267 | /** |
||
268 | * {@inheritdoc} |
||
269 | */ |
||
270 | public function getWidget($widget) { |
||
273 | |||
274 | /** |
||
275 | * {@inheritdoc} |
||
276 | */ |
||
277 | public function getWidgets() { |
||
287 | |||
288 | /** |
||
289 | * {@inheritdoc} |
||
290 | */ |
||
291 | public function addWidget(array $configuration) { |
||
296 | |||
297 | /** |
||
298 | * {@inheritdoc} |
||
299 | */ |
||
300 | public function deleteWidget(WidgetInterface $widget) { |
||
305 | |||
306 | /** |
||
307 | * {@inheritdoc} |
||
308 | */ |
||
309 | public function getFirstWidget() { |
||
313 | |||
314 | /** |
||
315 | * {@inheritdoc} |
||
316 | */ |
||
317 | public function addAdditionalWidgetParameters(array $parameters) { |
||
322 | |||
323 | /** |
||
324 | * {@inheritdoc} |
||
325 | */ |
||
326 | public function getAdditionalWidgetParameters() { |
||
330 | |||
331 | /** |
||
332 | * Returns selection display plugin collection. |
||
333 | * |
||
334 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
335 | * The tag plugin collection. |
||
336 | */ |
||
337 | protected function selectionDisplayPluginCollection() { |
||
344 | |||
345 | /** |
||
346 | * {@inheritdoc} |
||
347 | */ |
||
348 | public function getSelectionDisplay() { |
||
351 | |||
352 | /** |
||
353 | * Returns widget selector plugin collection. |
||
354 | * |
||
355 | * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection |
||
356 | * The tag plugin collection. |
||
357 | */ |
||
358 | protected function widgetSelectorPluginCollection() { |
||
369 | |||
370 | /** |
||
371 | * {@inheritdoc} |
||
372 | */ |
||
373 | public function getWidgetSelector() { |
||
376 | |||
377 | /** |
||
378 | * {@inheritdoc} |
||
379 | */ |
||
380 | public function route() { |
||
400 | |||
401 | /** |
||
402 | * {@inheritdoc} |
||
403 | */ |
||
404 | public function preSave(EntityStorageInterface $storage) { |
||
416 | |||
417 | /** |
||
418 | * Prevent plugin collections from being serialized and correctly serialize |
||
419 | * selected entities. |
||
420 | */ |
||
421 | public function __sleep() { |
||
439 | |||
440 | /** |
||
441 | * {@inheritdoc} |
||
442 | */ |
||
443 | public function save() { |
||
450 | |||
451 | /** |
||
452 | * {@inheritdoc} |
||
453 | */ |
||
454 | public function getFormObject() { |
||
459 | |||
460 | |||
461 | /** |
||
462 | * {@inheritdoc} |
||
463 | */ |
||
464 | protected function urlRouteParameters($rel) { |
||
477 | |||
478 | } |
||
479 |