23 lines
795 B
PHP
23 lines
795 B
PHP
<?php
|
|
namespace App\Models;
|
|
use CodeIgniter\Model;
|
|
class SettingsModel extends Model
|
|
{
|
|
protected $table = 'settings';
|
|
protected $primaryKey = 'setting_id';
|
|
protected $allowedFields = ['setting_id','site_name','site_title','favicon','logo','terms_service','footer_about','admin_email','mobile','copyright','pagination_limit','site_info','about_info','mail_protocol','mail_title','mail_host','mail_port','mail_encryption','mail_username','mail_password','currency','country','isactive','business_id'];
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|
|
|