protected function MultipleSubmitTestWidget::prepareEntities in Entity Browser 8
Same name and namespace in other branches
- 8.2 tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/MultipleSubmitTestWidget.php \Drupal\entity_browser_test\Plugin\EntityBrowser\Widget\MultipleSubmitTestWidget::prepareEntities()
Prepares the entities without saving them.
We need this method when we want to validate or perform other operations before submit.
Parameters
array $form: Complete form.
\Drupal\Core\Form\FormStateInterface $form_state: The form state object.
Return value
\Drupal\Core\Entity\EntityInterface[] Array of entities.
Overrides WidgetBase::prepareEntities
File
- tests/
modules/ entity_browser_test/ src/ Plugin/ EntityBrowser/ Widget/ MultipleSubmitTestWidget.php, line 43
Class
- MultipleSubmitTestWidget
- Test widget with multiple submit buttons for test purposes.
Namespace
Drupal\entity_browser_test\Plugin\EntityBrowser\WidgetCode
protected function prepareEntities(array $form, FormStateInterface $form_state) {
return $form_state
->getValue('dummy_entities', []);
}