public function SettingsForm::submitForm in Salesforce Suite 5.0.x
Same name in this branch
- 5.0.x src/Form/SettingsForm.php \Drupal\salesforce\Form\SettingsForm::submitForm()
- 5.0.x modules/salesforce_logger/src/Form/SettingsForm.php \Drupal\salesforce_logger\Form\SettingsForm::submitForm()
Same name and namespace in other branches
- 8.4 src/Form/SettingsForm.php \Drupal\salesforce\Form\SettingsForm::submitForm()
- 8.3 src/Form/SettingsForm.php \Drupal\salesforce\Form\SettingsForm::submitForm()
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 220
Class
- SettingsForm
- Creates authorization form for Salesforce.
Namespace
Drupal\salesforce\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('salesforce.settings');
$config
->set('show_all_objects', $form_state
->getValue('show_all_objects'));
$config
->set('standalone', $form_state
->getValue('standalone'));
$config
->set('global_push_limit', $form_state
->getValue('global_push_limit'));
$config
->set('pull_max_queue_size', $form_state
->getValue('pull_max_queue_size'));
$config
->set('limit_mapped_object_revisions', $form_state
->getValue('limit_mapped_object_revisions'));
$use_latest = $form_state
->getValue('use_latest');
$config
->set('use_latest', $use_latest);
if (!$use_latest) {
$versions = $this->client
->getVersions();
$version = $versions[$form_state
->getValue('rest_api_version')];
$config
->set('rest_api_version', $version);
}
$config
->save();
parent::submitForm($form, $form_state);
}