You are here

public function LibraryGeneralSettings::submitForm in Library 8

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 FormInterface::submitForm

File

src/Form/LibraryGeneralSettings.php, line 61

Class

LibraryGeneralSettings
General settings form.

Namespace

Drupal\library\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) : void {
  $config = $this
    ->configFactory()
    ->getEditable('library.settings');
  $config
    ->set('barcode_starting_point', $form_state
    ->getValue('barcode_starting_point'));
  $config
    ->set('anonymize_transactions', $form_state
    ->getValue('anonymize_transactions'));
  $config
    ->save();
}