servermgrv2/app/Models/CommonModel.php
2023-07-17 21:09:49 +09:00

59 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use App\Libraries\Log\Log;
use CodeIgniter\Model;
class CommonModel extends Model
{
// use CommonTrait;
protected $DBGroup = 'default';
// protected $table = 'user';
protected $primaryKey = 'uid';
protected $useAutoIncrement = true;
protected $insertID = 0;
protected $returnType = 'array'; //object,array,entity명::class
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [];
// Dates
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
//Index관련
public function setIndexWordFilter(string $word)
{
}
public function setIndexDateFilterTrit($start, $end)
{
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy($field, $order);
}
}