1
0

instances added god may help

This commit is contained in:
2026-02-23 12:58:19 +01:00
parent 25370a1a55
commit 99db252f60
290 changed files with 9858 additions and 4914 deletions

View File

@@ -6,7 +6,7 @@ use MintyPHP\DB;
class SettingRepository
{
public static function find(string $key): ?array
public function find(string $key): ?array
{
$row = DB::selectOne('select `key`, `value`, `description`, `updated_at` from settings where `key` = ? limit 1', $key);
if (!$row) {
@@ -15,16 +15,16 @@ class SettingRepository
return $row['settings'] ?? $row;
}
public static function getValue(string $key): ?string
public function getValue(string $key): ?string
{
$row = self::find($key);
$row = $this->find($key);
if (!$row) {
return null;
}
return array_key_exists('value', $row) ? (string) $row['value'] : null;
}
public static function set(string $key, ?string $value, ?string $description = null): bool
public function set(string $key, ?string $value, ?string $description = null): bool
{
$query = 'insert into settings (`key`, `value`, `description`) values (?, ?, ?) '
. 'on duplicate key update `value` = values(`value`), '