You are here

public function SettingsForm::submitForm in Commerce File 8.2

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/SettingsForm.php, line 23

Class

SettingsForm
Defines the Commerce file settings form.

Namespace

Drupal\commerce_file\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config = $this
    ->config('commerce_file.settings');
  $config
    ->set('enable_download_limit', $form_state
    ->getValue('enable_download_limit'))
    ->set('download_limit', $form_state
    ->getValue('download_limit'))
    ->save();
}