You are here

protected function FileUpload::getCurrentValue in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/EntityBrowser/Widget/FileUpload.php \Drupal\lightning_media\Plugin\EntityBrowser\Widget\FileUpload::getCurrentValue()

Returns the current input value, if any.

Parameters

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

Return value

mixed The input value, ready for further processing. Nothing will be done with the value if it's empty.

Overrides EntityFormProxy::getCurrentValue

1 call to FileUpload::getCurrentValue()
FileUpload::validate in src/Plugin/EntityBrowser/Widget/FileUpload.php

File

src/Plugin/EntityBrowser/Widget/FileUpload.php, line 27

Class

FileUpload
An Entity Browser widget for creating media entities from uploaded files.

Namespace

Drupal\lightning_media\Plugin\EntityBrowser\Widget

Code

protected function getCurrentValue(FormStateInterface $form_state) {
  $value = parent::getCurrentValue($form_state);
  return $value['fid'] ?? NULL;
}