You are here

public function BundlesSettingsForm::submitForm in Media PDF Thumbnail 8.3

Same name and namespace in other branches
  1. 8.4 src/Form/BundlesSettingsForm.php \Drupal\media_pdf_thumbnail\Form\BundlesSettingsForm::submitForm()

Form submission 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 ConfigFormBase::submitForm

File

src/Form/BundlesSettingsForm.php, line 116

Class

BundlesSettingsForm
Configure example settings for this site.

Namespace

Drupal\media_pdf_thumbnail\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $editableConfig = $this->configFactory
    ->getEditable(static::SETTINGS);
  foreach ($this
    ->getFieldsList() as $bundleId => $infos) {
    $editableConfig
      ->set($bundleId . '_field', $form_state
      ->getValue($bundleId . '_field'));
    $editableConfig
      ->set($bundleId . '_enable', $form_state
      ->getValue($bundleId . '_enable'));
  }
  $editableConfig
    ->save();
  parent::submitForm($form, $form_state);
}