orderBy(self::TITLE, 'asc'); $options = parent::getFormFieldOption($field, $options); break; } return $options; } public function getEntityByPK(int $uid): null|ZoneEntity { $this->where(self::PK, $uid); return $this->getEntity(); } public function getEntityByID(string $id): null|ZoneEntity { $this->where(self::TITLE, $id); return $this->getEntity(); } public function getEntitysByParent(AccountEntity $account_entity) { $this->where(self::PARENT, $account_entity->getPK()); return $this->getEntitys(); } //create용 public function create(array $formDatas = []): ZoneEntity { return $this->create_process(new ZoneEntity(), $formDatas); } //modify용 public function modify(ZoneEntity $entity, array $formDatas): ZoneEntity { return $this->modify_process($entity, $formDatas); } //도메인이 이미 존재하는지 체크 public function isUniqueDomain(AccountEntity $account_entity, string $domain): bool { $this->where(self::PARENT, $account_entity->getPK()); $this->where(self::TITLE, $domain); return is_null($this->first()) ? true : false; } //List 검색용 public function setList_WordFilter(string $word, $field = null): void { //Join을 해서 Record의 content(IP검색)을 하기위함 $this->join(RecordModel::TABLE, sprintf( "%s.%s=%s.%s", self::TABLE, self::PK, RecordModel::TABLE, RecordModel::PARENT )); parent::setList_WordFilter($word, $field); $this->orLike(RecordModel::TABLE . '.content', $word, 'both'); // $subquery = $this->db->table(RecordModel::TABLE)->select(RecordModel::PARENT)->like('content', $word, 'both'); // $this->orWhereIn(self::PK, $subquery); } public function setList_OrderBy(string $order = ""): void { //Join을 해서 도메인부터 Sorting하기위함 $this->join(AccountModel::TABLE, sprintf( "%s.%s=%s.%s", self::TABLE, self::PARENT, AccountModel::TABLE, AccountModel::PK )); $this->orderBy(AccountModel::TABLE . ".title ASC"); parent::setList_OrderBy($order); } }