vb_book/app/Models/SettingsModel.php
2024-10-29 15:37:48 +05:30

23 lines
761 B
PHP
Executable File

<?php
namespace App\Models;
use CodeIgniter\Model;
class SettingsModel extends Model
{
protected $table = 'settings';
protected $primaryKey = 'setting_id';
protected $allowedFields = ['business_id','setting_id','site_name','site_color','site_short_name','site_email','mobile','country','favicon','site_info','logo','terms_service','footer_about','about_info','copyright','pagination_limit','currency','created_on','created_by','updated_on','updated_by','isactive'];
public function saveData($data, $id = null)
{
if ($id === null) {
// Insert new record
return $this->insert($data);
} else {
// Update existing record
return $this->update($id, $data);
}
}
}