You are here

public function WorkspaceConfigForm::submitForm in Workspace 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 ConfigFormBase::submitForm

File

src/Form/WorkspaceConfigForm.php, line 91

Class

WorkspaceConfigForm
Class WorkspaceConfigForm.

Namespace

Drupal\workspace\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config_settings = $this
    ->config('workspace.settings');
  foreach ([
    'push_replication_settings' => $this
      ->t('Push replication settings'),
    'pull_replication_settings' => $this
      ->t('Pull replication settings'),
    'upstream' => $this
      ->t('Default target workspace'),
  ] as $key => $item) {
    $value_settings = $form_state
      ->getValue($key);
    $config_settings
      ->set($key, $value_settings)
      ->save();
  }
}