'if_exist|min_length[10]|max_length[200]', 'zone_uid' => 'if_exist|min_length[10]|max_length[200]', 'description' => 'if_exist|string', 'filter_id' => 'if_exist|min_length[10]|max_length[200]', 'filter_expression' => 'if_exist|string', 'filter_paused' => 'if_exist|in_list[on,off]', 'paused' => 'if_exist|in_list[on,off]', 'action' => 'if_exist|string', 'updated_at' => 'if_exist|valid_date', 'created_at' => 'if_exist|valid_date', ]; protected $validationMessages = []; protected $skipValidation = true; 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 getTableName() { return $this->table; } public function getEntity(string $uid): null|FirewallEntity { $entity = $this->asObject(FirewallEntity::class)->where('uid', $uid)->first(); if (is_null($entity)) { throw new \Exception(__METHOD__ . "에서 {$uid} 해당 정보가 없습니다."); } return $entity; } //Index 검색용 public function setIndexWordFilter(string $word) { $this->like('description', $word, 'both'); //befor , after , both $this->orLike('filter_expression', $word, 'both'); } public function setIndexDateFilter($start, $end) { $this->where('created_at >=', $start); $this->where('created_at <=', $end); } public function setIndexOrderBy($field, $order = 'ASC') { $this->orderBy("zone_uid ASC, description ASC, {$field} {$order}"); } }