Files
root d3da699e55
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m19s
fix deployment db issue and widthrawal administration page
2026-08-20 20:18:00 -04:00

36 lines
713 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class SettingsModel extends Model
{
protected $table = 'settings';
protected $primaryKey = 'id';
protected $allowedFields = [
'name',
'timezone',
'updated_by',
'created_at',
'updated_at'
];
protected $useTimestamps = true;
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
public function getSettings()
{
$rows = $this->orderBy('id', 'ASC')->findAll(1);
return $rows[0] ?? [];
}
public function updateSettings($data)
{
return $this->update(1, $data); // Assuming there's only one settings record
}
}
?>