orderBy(self::TITLE, 'asc'); $options = parent::getFormFieldInputOption($field, $options); break; } return $options; } public function getEntityByPK(int $uid): null|RecordEntity { $this->where(self::PK, $uid); return $this->getEntity(); } public function getEntityByID(string $id): null|RecordEntity { $this->where(self::TITLE, $id); return $this->getEntity(); } //create용 public function create(array $formDatas = []): RecordEntity { return $this->create_process(new RecordEntity(), $formDatas); } //modify용 public function modify(RecordEntity $entity, array $formDatas): RecordEntity { return $this->modify_process($entity, $formDatas); } public function getEntitysByParent(ZoneEntity $zone_entity) { $this->where(self::PARENT, $zone_entity->getPK()); return $this->getEntitys(); } //도메인이 이미 존재하는지 체크 public function isUniqueHost($zone_uid, string $host, string $content): bool { $this->where(self::PARENT, $zone_uid); $this->where('host', $host); $this->where('content', $content); return is_null($this->first()) ? true : false; } //CDN값 수정 못하는 고정 Record 처리 public function setFixedCDNRecord(array $hosts) { if (count($hosts)) { $this->whereIn('host', $hosts)->set(['fixed' => 'on'])->update(); log_message("notice", "-----set fixed Records " . implode(",", $hosts) . "처리 완료-----"); } } //List 검색용 public function setList_WordFilter(string $word, $field = null): void { parent::setList_WordFilter($word, $field); $this->orLike('content', $word, 'both'); } public function setList_OrderBy(string $order) { //Join을 해서 도메인부터 Sorting하기위함 $this->join('cloudflarezone', "cloudflarezone.uid=cloudflarerecord.zone_uid"); $this->orderBy("cloudflare.domain ASC"); parent::setList_OrderBy($order); } }