getFilterFields(); } public function getFieldRule(string $action, string $field): string { switch ($field) { case self::PK: $rule = "required|trim|string"; $rule .= $action == "create" ? "|is_unique[{$this->table}.{$field}]" : ""; break; case self::TITLE: case 'actor': case 'zone_name': case "status": $rule = "required|trim|string"; break; case 'interface': case 'action_info': $rule = "if_exist|string"; break; case 'meta': case 'resource': $rule = "if_exist"; break; default: $rule = parent::getFieldRule($action, $field); break; } return $rule; } public function getEntityByPK(string $uid): null|AuditLogEntity { $this->where(self::PK, $uid); return $this->getEntity(); } public function getEntityByID(string $id): null|AuditLogEntity { $this->where(self::TITLE, $id); return $this->getEntity(); } //create용 public function create(array $formDatas = []): AuditLogEntity { return $this->create_process(new AuditLogEntity(), $formDatas); } //modify용 public function modify(AuditLogEntity $entity, array $formDatas): AuditLogEntity { 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 . '.zone_name', $word, 'both'); $this->orLike(self::TABLE . '.meta', $word, 'both'); $this->orLike(self::TABLE . '.resource', $word, 'both'); } }