-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingModel.php
More file actions
51 lines (41 loc) · 1.46 KB
/
SettingModel.php
File metadata and controls
51 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @see https://github.com/codenomdev/codeigniter4-framework for the canonical source repository
*
* @copyright 2020 - Codenom Dev (https://codenom.com).
* @license https://github.com/codenomdev/codeigniter4-framework/blob/master/LICENSE MIT License
*/
namespace Codenom\Framework\Models\Setting;
use CodeIgniter\Model;
use Codenom\Framework\Entities\Setting\SettingEntity;
use Codenom\Framework\Data\Setting\SettingManager;
class SettingModel extends Model
{
protected $table = 'setting';
protected $primaryKey = 'id';
protected $returnType = SettingEntity::class;
protected $useSoftDeletes = false;
protected $allowedFields = ['value'];
protected $useTimestamps = false;
// protected $beforeUpdate = ['beforeUpdate'];
// protected $validationRules = [
// 'code' => 'required|min_length[3]|max_length[15]',
// 'key' => 'required|min_length[3]|max_length[50]',
// ];
protected $validationMessages = [];
protected $skipValidation = false;
// public function updateSetting($key, $post){
// $this->db->update($key, )
// }
// public function deleteZone(int $id)
// {
// cache()->delete($id . '_zoneData');
// cache()->delete($id . '_zoneCountryCollection');
// return $this->db->table($this->table)->where(['id' => $id])->delete();
// }
// protected function beforeUpdate($data)
// {
// cache()->clean();
// return $data;
// }
}