addClassName('Customer'); } final public function getClientService(): ClientService { if (!$this->_clientService) { $this->_clientService = new ClientService(); } return $this->_clientService; } final public function getUSerService(): UserService { if (!$this->_userService) { $this->_userService = new UserService(); } return $this->_userService; } final public function getServiceService(): ServiceService { if (!$this->_serviceService) { $this->_serviceService = new ServiceService(); } return $this->_serviceService; } final public function getServerService(): ServerService { if (!$this->_serverService) { $this->_serverService = new ServerService(); } return $this->_serverService; } //ServiceItemController,ServiceController에서 사용 //기본기능 //FieldForm관련용 public function getFormOption(string $field, array $options = []): array { switch ($field) { case 'user_uid': $options = $this->getUserService()->getEntities(); break; case 'clientinfo_uid': $options = $this->getClientService()->getEntities(); break; case 'serviceinfo_uid': $options = $this->getServiceService()->getEntities(); break; case 'serverinfo_uid': $options = $this->getServerService()->getEntities(); break; default: $options = parent::getFormOption($field, $options); break; } return $options; } //ItemType에 따른 FilterOption 설정용 final public function getClient(int $uid): ClientEntity { $entity = $this->getClientService()->getEntity($uid); if (!$entity) { throw new \Exception("{$uid}에 해당하는 고객정보가 존재하지 않습니다. uid: {$uid}"); } return $entity; } }