This commit is contained in:
Václav Španinger 2020-12-09 12:28:31 +01:00
parent 181a65a99b
commit 74f6779c63

View File

@ -22,6 +22,9 @@ class SettingsManager{
} }
public static function update ($name, $value) { public static function update ($name, $value) {
if ($this.getByName($name)){
$this->create($name, $value);
} else {
try { try {
Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name)); Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name));
} catch(PDOException $error) { } catch(PDOException $error) {
@ -30,4 +33,5 @@ class SettingsManager{
} }
} }
} }
}
?> ?>