public function MediaImageUpload::submit in Entity Browser 8.2
Submits form.
Parameters
array $element: Widget part of the form.
array $form: Form.
\Drupal\Core\Form\FormStateInterface $form_state: Form state object.
Overrides Upload::submit
File
- src/
Plugin/ EntityBrowser/ Widget/ MediaImageUpload.php, line 78
Class
- MediaImageUpload
- Uses upload to create media images.
Namespace
Drupal\entity_browser\Plugin\EntityBrowser\WidgetCode
public function submit(array &$element, array &$form, FormStateInterface $form_state) {
if (!empty($form_state
->getTriggeringElement()['#eb_widget_main_submit'])) {
$images = $this
->prepareEntities($form, $form_state);
array_walk($images, function (MediaInterface $media) {
$media
->save();
});
$this
->selectEntities($images, $form_state);
$this
->clearFormValues($element, $form_state);
}
}