diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-20 17:27:17 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-20 17:27:17 +0100 |
| commit | 22dbec47d3246b385c28609d10644a47af0a2f8d (patch) | |
| tree | 5816c6caa439e802daf3747bb509f391b400d4a5 /lib/classes | |
| parent | 4145100a0f2fdd412dafab99c41ddd998d9ad4b3 (diff) | |
introduce Config::reset() to reset a config value, fixes #6287tic-6287-config-reset
Diffstat (limited to 'lib/classes')
| -rw-r--r-- | lib/classes/Config.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/classes/Config.php b/lib/classes/Config.php index 20eebdc..434c5a9 100644 --- a/lib/classes/Config.php +++ b/lib/classes/Config.php @@ -358,6 +358,16 @@ class Config implements ArrayAccess, Countable, IteratorAggregate } /** + * Resets the configuration to it's default value. + * + * @return int The number of removed value entries + */ + public function reset(string $field): int + { + return ConfigValue::deleteBySql('field=?', [$field]); + } + + /** * delete config entry from database * @param string name of entry * @throws InvalidArgumentException |
