addClassName('Server'); } public function getFormFields(): array { return [ "code", "type", "title", "partinfo_uid", "price", "manufactur_at", "format_at", "status", ]; } public function getFilterFields(): array { return ['clientinfo_uid', 'serviceinfo_uid', 'type', 'title', 'status', 'partinfo_uid']; } public function getBatchJobFields(): array { return ['clientinfo_uid', 'type', 'status']; } public function getIndexFields(): array { return ['clientinfo_uid', 'serviceinfo_uid', "type", 'title', 'price', 'total_price', 'manufactur_at', "format_at", 'status']; } final public function getPartService(): PartService { if (!$this->_partService) { $this->_partService = new PartService(); } return $this->_partService; } final public function getIPService(): IPService { if (!$this->_ipService) { $this->_ipService = new IPService(); } return $this->_ipService; } final public function getCSService(): CSService { if (!$this->_csService) { $this->_csService = new CSService(); } return $this->_csService; } //기본 기능부분 //FieldForm관련용 public function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case 'partinfo_uid': $options = $this->getPartService()->getEntities(['status' => PartEntity::STATUS_AVAILABLE]); break; case 'ipinfo_uid': //수정때문에 전체가 필요 // $options = $this->getIPService()->getEntities(['status' => IPEntity::STATUS_AVAILABLE]); $options = $this->getIPService()->getEntities(); break; case 'csinfo_uid': //수정때문에 전체가 필요 // $options = $this->getCSService()->getEntities(['status' => CSEntity::STATUS_AVAILABLE]); $options = $this->getCSService()->getEntities(); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } //create용 장비코드 마지막번호 가져오기 final public function getLastestCode(int $default = 1): string { return $this->getModel()->getLastestCode($default); } //List 검색용 //OrderBy 처리 public function setOrderBy(mixed $field = null, mixed $value = null): void { $this->getModel()->orderBy("code ASC,title ASC"); parent::setOrderBy($field, $value); } }