You are here

public function SettingsForm::submitForm in Amazon Product Advertisement API 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 109
Contains Drupal\amazon\Form\SettingsForm.

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\amazon\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('amazon.settings')
    ->set('access_key', $form_state
    ->getValue('access_key'))
    ->set('access_secret', $form_state
    ->getValue('access_secret'))
    ->set('associates_id', $form_state
    ->getValue('associates_id'))
    ->set('default_max_age', $form_state
    ->getValue('default_max_age'))
    ->save();
}