content_title = lang("{$this->getService()->getClassName()}.title"); $this->class_path .= $this->getService()->getClassName(); $this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/'; // $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR; } public function getService(): ServiceService { if (!$this->_service) { $this->_service = new ServiceService($this->request); } return $this->_service; } public function getHelper(): ServiceHelper { if (!$this->_helper) { $this->_helper = new ServiceHelper($this->request); } return $this->_helper; } public function getCodeService(): CodeService { if (!$this->_codeService) { $this->_codeService = new CodeService($this->request); } return $this->_codeService; } public function getServiceItemService(): ServiceItemService { if (!$this->_serviceItemService) { $this->_serviceItemService = new ServiceItemService($this->request); } return $this->_serviceItemService; } protected function initAction(string $action): void { //$item_type(CPU,RAM,STORAGE등)에 따라 선언된 getFormFieldOption용 사용됨 (initAction보다 먼저 호출해야 됨) $this->initServiceItemOptions(); parent::initAction($action); } protected function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case 'ownerinfo_uid': foreach ($this->getClientService()->getEntities() as $entity) { $options[$entity->getPK()] = $entity->getTitle(); } break; case 'code': $occupied_codes = []; foreach ($this->getCodeService()->getEntities() as $entity) { $options[$entity->getPK()] = $entity->getTitle(); if ($entity->getStatus() === CodeEntity::STATUS_OCCUPIED) { $occupied_codes[] = $entity->getPK(); } } //code의 경우 사용중인 filter_options코드전달용 $this->occupied_codes = $occupied_codes; break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string { switch ($this->getAction()) { case 'index': $result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'service'); break; default: $result = parent::getResultSuccess($message, $actionTemplate); break; } return $result; } protected function setWordConditionForList(): void { $this->word = $this->request->getVar('word'); if ($this->word !== null && $this->word !== '') { if ($this->getHelper()->isIPAddress($this->word, 'ipv4')) { $this->getService()->setSearchIp($this->word); } else { $this->getService()->getModel()->setList_WordFilter($this->word); } } } //Index,FieldForm관련 protected function index_process(): array { $entities = []; foreach (parent::index_process() as $entity) { foreach (SERVICE_ITEM_TYPES as $item_type => $label) { $entity->setItemEntities( $item_type, $this->getServiceItemService()->getEntities(['serviceinfo_uid' => $entity->getPK(), 'item_type' => $item_type]) ); } $entities[] = $entity; } // $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임 return $entities; } }