public function SmartIpEventSubscriber::submitFormSettings in Smart IP 8.4
Same name in this branch
- 8.4 modules/device_geolocation/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\device_geolocation\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
- 8.4 modules/smart_ip_maxmind_geoip2_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_maxmind_geoip2_bin_db\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
- 8.4 modules/smart_ip_ipinfodb_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
- 8.4 modules/smart_ip_ip2location_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_ip2location_bin_db\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
- 8.4 modules/smart_ip_abstract_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_abstract_web_service\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
- 8.4 modules/smart_ip_maxmind_geoip2_web_service/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_maxmind_geoip2_web_service\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
Same name and namespace in other branches
- 8.3 modules/smart_ip_ip2location_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php \Drupal\smart_ip_ip2location_bin_db\EventSubscriber\SmartIpEventSubscriber::submitFormSettings()
Act on submission of main Smart IP admin settings form.
Parameters
\Drupal\smart_ip\AdminSettingsEvent $event: Smart IP admin settings override event for event listeners.
Overrides SmartIpDataSourceInterface::submitFormSettings
File
- modules/
smart_ip_ip2location_bin_db/ src/ EventSubscriber/ SmartIpEventSubscriber.php, line 469 - Contains \Drupal\smart_ip_ip2location_bin_db\EventSubscriber\SmartIpEventSubscriber.
Class
- SmartIpEventSubscriber
- Core functionality of this Smart IP data source module. Listens to Smart IP override events.
Namespace
Drupal\smart_ip_ip2location_bin_db\EventSubscriberCode
public function submitFormSettings(AdminSettingsEvent $event) {
/** @var \Drupal\Core\Form\FormStateInterface $formState */
$formState = $event
->getFormState();
if ($formState
->getValue('smart_ip_data_source') == self::sourceId()) {
$config = \Drupal::configFactory()
->getEditable(self::configName());
if ($formState
->getValue('ip2location_bin_db_version') == Ip2locationBinDb::LINCENSED_VERSION) {
$edition = $formState
->getValue('ip2location_bin_db_edition_licensed');
}
else {
$edition = $formState
->getValue('ip2location_bin_db_edition_lite');
}
$config
->set('version', $formState
->getValue('ip2location_bin_db_version'))
->set('edition', $edition)
->set('token', $formState
->getValue('ip2location_bin_db_token'))
->set('db_auto_update', $formState
->getValue('ip2location_bin_db_auto_update'))
->set('caching_method', $formState
->getValue('ip2location_bin_db_caching_method'))
->set('bin_file_custom_path', $formState
->getValue('ip2location_bin_db_custom_path'))
->save();
}
}