You are here

public function Settings::submitForm in Google API PHP Client 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/Settings.php, line 149

Class

Settings
Google API Settings.

Namespace

Drupal\google_api_client\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('google_api_client.settings')
    ->set('credentials', $form_state
    ->getValue('credentials'))
    ->set('scopes', $form_state
    ->getValue('scopes'))
    ->save();
  parent::submitForm($form, $form_state);
}