'if_exist|numeric', 'id' => 'if_exist|valid_email', 'authkey' => 'if_exist|min_length[10]|max_length[200]', 'oldkey' => 'if_exist|min_length[10]|max_length[200]', '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(string $uid): null|AuthEntity { $entity = $this->asObject(AuthEntity::class)->where('uid', $uid)->first(); if (is_null($entity)) { throw new \Exception(__METHOD__ . "에서 {$uid} 해당 정보가 없습니다."); } return $entity; } //Index 검색용 public function setIndexWordFilter(string $word) { $this->like('id', $word, 'both'); //befor , after , both } public function setIndexDateFilter($start, $end) { $this->where('created_at >=', $start); $this->where('created_at <=', $end); } //도메인이 이미 존재하는지 체크 public function isUniqueApikey(string $uid): bool { $this->where('uid', $uid); return is_null($this->find()) ? true : false; } }