class ConfigHandler in DB Maintenance 8
Same name and namespace in other branches
- 7.2 src/Module/Config/ConfigHandler.php \Drupal\db_maintenance\Module\Config\ConfigHandler
- 2.0.x src/Module/Config/ConfigHandler.php \Drupal\db_maintenance\Module\Config\ConfigHandler
ConfigHandler class.
Hierarchy
- class \Drupal\db_maintenance\Module\Config\ConfigHandler
Expanded class hierarchy of ConfigHandler
4 files declare their use of ConfigHandler
- CommonHookHandler.php in src/
Module/ Hook/ CommonHookHandler.php - CommonHookHandler class.
- DbHandler.php in src/
Module/ Db/ DbHandler.php - DbHandler class.
- DbMaintenanceAdminSettings.php in src/
Form/ DbMaintenanceAdminSettings.php - Contains \Drupal\db_maintenance\Form\DbMaintenanceAdminSettings.
- IntervalHandler.php in src/
Module/ Interval/ IntervalHandler.php - IntervalHandler class.
File
- src/
Module/ Config/ ConfigHandler.php, line 13 - ConfigHandler class.
Namespace
Drupal\db_maintenance\Module\ConfigView source
class ConfigHandler {
/**
* Returns last cron run.
*/
public static function getCronLastRun() {
$val = \Drupal::config('db_maintenance.settings')
->get('cron_last_run');
return $val;
}
/**
* Sets last cron run.
*/
public static function setCronLastRun($value) {
$config = \Drupal::configFactory()
->getEditable('db_maintenance.settings');
$config
->set('cron_last_run', $value);
$config
->save();
}
/**
* Returns cron frequency.
*/
public static function getCronFrequency() {
$val = \Drupal::config('db_maintenance.settings')
->get('cron_frequency');
return $val;
}
/**
* Returns Log config value.
*/
public static function getWriteLog() {
$val = \Drupal::config('db_maintenance.settings')
->get('write_log');
return $val;
}
/**
* Returns UseTimeInterval variable.
*/
public static function getUseTimeInterval() {
$val = \Drupal::config('db_maintenance.settings')
->get('use_time_interval');
return $val;
}
/**
* Returns TimeIntervalStart variable.
*/
public static function getTimeIntervalStart() {
$val = \Drupal::config('db_maintenance.settings')
->get('time_interval_start');
return $val;
}
/**
* Returns TimeIntervalEnd variable.
*/
public static function getTimeIntervalEnd() {
$val = \Drupal::config('db_maintenance.settings')
->get('time_interval_end');
return $val;
}
/**
* Returns AllTables config value.
*/
public static function getProcessAllTables() {
$val = \Drupal::config('db_maintenance.settings')
->get('all_tables');
return $val;
}
/**
* Returns TableList config value.
*/
public static function getTableList($database, $default = NULL) {
$val = \Drupal::config('db_maintenance.settings')
->get('table_list_' . $database);
if (is_null($val)) {
// This config key does not exist.
return $default;
}
return $val;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigHandler:: |
public static | function | Returns cron frequency. | |
ConfigHandler:: |
public static | function | Returns last cron run. | |
ConfigHandler:: |
public static | function | Returns AllTables config value. | |
ConfigHandler:: |
public static | function | Returns TableList config value. | |
ConfigHandler:: |
public static | function | Returns TimeIntervalEnd variable. | |
ConfigHandler:: |
public static | function | Returns TimeIntervalStart variable. | |
ConfigHandler:: |
public static | function | Returns UseTimeInterval variable. | |
ConfigHandler:: |
public static | function | Returns Log config value. | |
ConfigHandler:: |
public static | function | Sets last cron run. |