'if_exist|numeric', 'user_uid' => 'if_exist|numeric', 'title' => 'if_exist|string', 'content' => 'if_exist|string', 'status' => 'if_exist|in_list[use,unuse]', 'updated_at' => 'if_exist|valid_date', 'created_at' => 'if_exist|valid_date', ]; 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 = []; public function getEntity(int $uid): null|LoggerEntity { $entity = $this->asObject(LoggerEntity::class)->where('uid', $uid)->first(); if (is_null($entity)) { throw new \Exception(__METHOD__ . "에서 {$uid} 해당 정보가 없습니다."); } return $entity; } public function setIndexWordFilter(string $word) { $this->orLike('title', $word, 'both'); $this->orLike('content', $word, 'both'); //befor , after , both } public function setIndexDateFilter($start, $end) { $this->where('created_at >=', $start); $this->where('created_at <=', $end); } public function setIndexOrderBy($field, $order = 'ASC') { $this->orderBy("{$field} {$order}"); } }