You are here

private function MediaElementConfigForm::getConfigurationValues in MediaElement 8

Prepare our configuration items for saving.

Parameters

array $fields: The field names we want to parse.

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

Return value

array The settings to save keyed by their name.

1 call to MediaElementConfigForm::getConfigurationValues()
MediaElementConfigForm::submitForm in src/Form/MediaElementConfigForm.php
Form submission handler.

File

src/Form/MediaElementConfigForm.php, line 268

Class

MediaElementConfigForm
Configuration form for MediaElement.js module.

Namespace

Drupal\mediaelement\Form

Code

private function getConfigurationValues(array $fields, FormStateInterface $form_state) {
  $values = [];
  foreach ($fields as $field) {
    $value = $form_state
      ->getValue($field);
    if (!empty($value) || $value === 0) {
      $values[$field] = $value;
    }
  }
  return $values;
}