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