public function DropzoneJsEbWidget::submit in DropzoneJS 8.2
Same name and namespace in other branches
- 8 modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php \Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget::submit()
1 method overrides DropzoneJsEbWidget::submit()
- MediaEntityDropzoneJsEbWidget::submit in modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ MediaEntityDropzoneJsEbWidget.php
File
- modules/
eb_widget/ src/ Plugin/ EntityBrowser/ Widget/ DropzoneJsEbWidget.php, line 308
Class
- DropzoneJsEbWidget
- Provides an Entity Browser widget that uploads new files.
Namespace
Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\WidgetCode
public function submit(array &$element, array &$form, FormStateInterface $form_state) {
$files = [];
foreach ($this
->prepareEntities($form, $form_state) as $file) {
$file
->setPermanent();
$file
->save();
$files[] = $file;
}
$this
->selectEntities($files, $form_state);
$this
->clearFormValues($element, $form_state);
}