addClassName('Server'); } public function getFormFields(): array { return [ 'fields' => [ "partinfo_uid", "serverinfo_uid", "serviceinfo_uid", "billing", "amount", "cnt", "extra", ], 'filters' => [ "partinfo_uid", "serverinfo_uid", "serviceinfo_uid", ], ]; } public function getIndexFields(): array { return $this->getFormFields(); } public function getBatchjobFields(): array { return ['partinfo_uid', "serverinfo_uid", "serviceinfo_uid",]; } final public function getPartService(): PartService { if (!$this->_partService) { $this->_partService = new PartService(); } return $this->_partService; } //기본 기능부분 //FieldForm관련용 public function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case 'partinfo_cpu_uid': $options = $this->getPartService()->getEntities(['type' => 'CPU']); break; case 'partinfo_ram_uid': $options = $this->getPartService()->getEntities(['type' => 'RAM']); break; case 'partinfo_disk_uid': $options = $this->getPartService()->getEntities(['type' => 'DISK']); break; case 'partinfo_os_uid': $options = $this->getPartService()->getEntities(['type' => 'OS']); break; case 'partinfo_db_uid': $options = $this->getPartService()->getEntities(['type' => 'DB']); break; case 'partinfo_software_uid': $options = $this->getPartService()->getEntities(['type' => 'SOFTWARE']); break; case 'partinfo_uid': //수정때문에 전체가 필요 $options = $this->getPartService()->getEntities(); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } //partEntity 정보 추가 protected function getEntity_process(mixed $entity): mixed { $entity->setPartEntity($this->getPartService()->getEntity($entity->getPartInfoUID())); return $entity; } }