You are here

protected function BynderUpload::clearFormValues in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/EntityBrowser/Widget/BynderUpload.php \Drupal\bynder\Plugin\EntityBrowser\Widget\BynderUpload::clearFormValues()
  2. 8 src/Plugin/EntityBrowser/Widget/BynderUpload.php \Drupal\bynder\Plugin\EntityBrowser\Widget\BynderUpload::clearFormValues()
  3. 8.2 src/Plugin/EntityBrowser/Widget/BynderUpload.php \Drupal\bynder\Plugin\EntityBrowser\Widget\BynderUpload::clearFormValues()

Clear values from upload form element.

Parameters

array $element: Upload form element.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

1 call to BynderUpload::clearFormValues()
BynderUpload::submit in src/Plugin/EntityBrowser/Widget/BynderUpload.php

File

src/Plugin/EntityBrowser/Widget/BynderUpload.php, line 427

Class

BynderUpload
Uses upload to create media entities.

Namespace

Drupal\bynder\Plugin\EntityBrowser\Widget

Code

protected function clearFormValues(array &$element, FormStateInterface $form_state) {
  $form_state
    ->setValueForElement($element['upload']['uploaded_files'], '');
  NestedArray::setValue($form_state
    ->getUserInput(), $element['upload']['uploaded_files']['#parents'], '');
  $form_state
    ->set('uploaded_entities', NULL);
}