getFilterFields(); } public function getFieldRule(string $action, string $field): string { if (is_array($field)) { throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true)); } switch ($field) { case "oldurl": $rule = "required|valid_url_strict"; $rule .= $action == "create" ? "|is_unique[{$this->table}.{$field}]" : ""; break; case "newurl": $rule = "required|valid_url_strict"; break; default: $rule = parent::getFieldRule($action, $field); break; } return $rule; } public function getEntityByPK(string $uid): null|MapurlEntity { $this->where($this->getPKField(), intval($uid)); return $this->getEntity(); } //create용 public function create(array $formDatas = []): MapurlEntity { return $this->create_process(new MapurlEntity(), $formDatas); } //modify용 public function modify(MapurlEntity $entity, array $formDatas): MapurlEntity { return $this->modify_process($entity, $formDatas); } //List 검색용 public function setList_WordFilter(string $word): void { $this->orLike(self::TABLE . "." . self::TITLE, $word, 'both'); $this->orLike(self::TABLE . '.new_url', $word, 'both'); } }