You are here

private function AdminSettingsForm::setCredentialValues in Acquia Lift Connector 8

Same name and namespace in other branches
  1. 8.4 src/Form/AdminSettingsForm.php \Drupal\acquia_lift\Form\AdminSettingsForm::setCredentialValues()
  2. 8.3 src/Form/AdminSettingsForm.php \Drupal\acquia_lift\Form\AdminSettingsForm::setCredentialValues()

Set credential values.

Parameters

\Drupal\Core\Config\Config $settings: Acquia Lift config settings.

array $values: Credential values.

1 call to AdminSettingsForm::setCredentialValues()
AdminSettingsForm::submitForm in src/Form/AdminSettingsForm.php
Form submission handler.

File

src/Form/AdminSettingsForm.php, line 336
Contains \Drupal\acquia_lift\Form\AdminSettingsForm.

Class

AdminSettingsForm
Defines a form that configures settings.

Namespace

Drupal\acquia_lift\Form

Code

private function setCredentialValues(Config $settings, array $values) {
  $settings
    ->set('credential.account_name', $values['account_name']);
  $settings
    ->set('credential.customer_site', $values['customer_site']);
  $settings
    ->set('credential.api_url', $this
    ->removeProtocal($values['api_url']));
  $settings
    ->set('credential.access_key', $values['access_key']);
  if (!empty($values['secret_key'])) {
    $settings
      ->set('credential.secret_key', $values['secret_key']);
  }
  $settings
    ->set('credential.js_path', $this
    ->removeProtocal($values['js_path']));
}