aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/Config.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2026-02-20 17:27:17 +0100
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2026-02-20 17:27:17 +0100
commit22dbec47d3246b385c28609d10644a47af0a2f8d (patch)
tree5816c6caa439e802daf3747bb509f391b400d4a5 /lib/classes/Config.php
parent4145100a0f2fdd412dafab99c41ddd998d9ad4b3 (diff)
introduce Config::reset() to reset a config value, fixes #6287tic-6287-config-reset
Diffstat (limited to 'lib/classes/Config.php')
-rw-r--r--lib/classes/Config.php10
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