1 | <?php |
||
19 | class EntityBrowserForm extends FormBase implements EntityBrowserFormInterface { |
||
20 | |||
21 | /** |
||
22 | * The entity browser object. |
||
23 | * |
||
24 | * @var \Drupal\entity_browser\EntityBrowserInterface |
||
25 | */ |
||
26 | protected $entity_browser; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function getFormId() { |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function setEntityBrowser(EntityBrowserInterface $entity_browser) { |
||
41 | |||
42 | /** |
||
43 | * Initializes form state. |
||
44 | * |
||
45 | * @param \Drupal\Core\Form\FormStateInterface |
||
46 | * Form state object. |
||
47 | */ |
||
48 | protected function init(FormStateInterface $form_state) { |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function buildForm(array $form, FormStateInterface $form_state) { |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function validateForm(array &$form, FormStateInterface $form_state) { |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function submitForm(array &$form, FormStateInterface $form_state) { |
||
141 | |||
142 | /** |
||
143 | * Returns the widget that is currently selected. |
||
144 | * |
||
145 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
146 | * The current state of the form. |
||
147 | * |
||
148 | * @return string |
||
149 | * ID of currently selected widget. |
||
150 | */ |
||
151 | protected function getCurrentWidget(FormStateInterface $form_state) { |
||
159 | |||
160 | /** |
||
161 | * Sets widget that is currently active. |
||
162 | * |
||
163 | * @param string $widget |
||
164 | * New active widget UUID. |
||
165 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
166 | * Form state. |
||
167 | */ |
||
168 | protected function setCurrentWidget($widget, FormStateInterface $form_state) { |
||
171 | |||
172 | /** |
||
173 | * Indicates selection is done. |
||
174 | * |
||
175 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
176 | * Form state. |
||
177 | * |
||
178 | * @return bool |
||
179 | * Indicates selection is done. |
||
180 | */ |
||
181 | protected function isSelectionCompleted(FormStateInterface $form_state) { |
||
184 | |||
185 | /** |
||
186 | * Returns currently selected entities. |
||
187 | * |
||
188 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
||
189 | * Form state. |
||
190 | * |
||
191 | * @return \Drupal\Core\Entity\EntityInterface[] |
||
192 | * Array of currently selected entities. |
||
193 | */ |
||
194 | protected function getSelectedEntities(FormStateInterface $form_state) { |
||
197 | |||
198 | } |
||
199 |