You are here

public function AddFormBase::validateForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::validateForm()
  2. 10 core/modules/media_library/src/Form/AddFormBase.php \Drupal\media_library\Form\AddFormBase::validateForm()

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

core/modules/media_library/src/Form/AddFormBase.php, line 649

Class

AddFormBase
Provides a base class for creating media items from within the media library.

Namespace

Drupal\media_library\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  foreach ($this
    ->getAddedMediaItems($form_state) as $delta => $media) {
    $this
      ->validateMediaEntity($media, $form, $form_state, $delta);
  }
}