1 | <?php |
||
21 | class EntityBrowserForm extends FormBase implements EntityBrowserFormInterface { |
||
22 | |||
23 | /** |
||
24 | * The entity browser object. |
||
25 | * |
||
26 | * @var \Drupal\entity_browser\EntityBrowserInterface |
||
27 | */ |
||
28 | protected $entity_browser; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function getFormId() { |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function setEntityBrowser(EntityBrowserInterface $entity_browser) { |
||
43 | |||
44 | /** |
||
45 | * Initializes form state. |
||
46 | * |
||
47 | * @param \Drupal\Core\Form\FormStateInterface |
||
48 | * Form state object. |
||
49 | */ |
||
50 | protected function init(FormStateInterface $form_state) { |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function buildForm(array $form, FormStateInterface $form_state) { |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function validateForm(array &$form, FormStateInterface $form_state) { |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function submitForm(array &$form, FormStateInterface $form_state) { |
||
143 | |||
144 | /** |
||
145 | * Returns the widget that is currently selected. |
||
146 | * |
||
147 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
148 | * The current state of the form. |
||
149 | * |
||
150 | * @return string |
||
151 | * ID of currently selected widget. |
||
152 | */ |
||
153 | protected function getCurrentWidget(FormStateInterface $form_state) { |
||
161 | |||
162 | /** |
||
163 | * Sets widget that is currently active. |
||
164 | * |
||
165 | * @param string $widget |
||
166 | * New active widget UUID. |
||
167 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
168 | * Form state. |
||
169 | */ |
||
170 | protected function setCurrentWidget($widget, FormStateInterface $form_state) { |
||
173 | |||
174 | /** |
||
175 | * Indicates selection is done. |
||
176 | * |
||
177 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
178 | * Form state. |
||
179 | * |
||
180 | * @return bool |
||
181 | * Indicates selection is done. |
||
182 | */ |
||
183 | protected function isSelectionCompleted(FormStateInterface $form_state) { |
||
186 | |||
187 | /** |
||
188 | * Returns currently selected entities. |
||
189 | * |
||
190 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
191 | * Form state. |
||
192 | * |
||
193 | * @return \Drupal\Core\Entity\EntityInterface[] |
||
194 | * Array of currently selected entities. |
||
195 | */ |
||
196 | protected function getSelectedEntities(FormStateInterface $form_state) { |
||
199 | |||
200 | } |
||
201 |