public function MediaDeleteForm::submitModalAjax in Media Directories 3.x
Same name and namespace in other branches
- 8 modules/media_directories_ui/src/Form/MediaDeleteForm.php \Drupal\media_directories_ui\Form\MediaDeleteForm::submitModalAjax()
- 2.x modules/media_directories_ui/src/Form/MediaDeleteForm.php \Drupal\media_directories_ui\Form\MediaDeleteForm::submitModalAjax()
File
- modules/
media_directories_ui/ src/ Form/ MediaDeleteForm.php, line 91
Class
Namespace
Drupal\media_directories_ui\FormCode
public function submitModalAjax(array &$form, FormStateInterface $form_state) {
$response = new AjaxResponse();
foreach ($this->entities as $entity) {
$entity
->delete();
}
$response
->addCommand(new CloseModalDialogCommand());
$response
->addCommand(new LoadDirectoryContent());
return $response;
}