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(): ServerService { if (!$this->_service) { $this->_service = new ServerService($this->request); } return $this->_service; } public function getHelper(): ServerHelper { if (!$this->_helper) { $this->_helper = new ServerHelper($this->request); } return $this->_helper; } final public function getCpuService(): CpuService { if (!$this->_cpuService) { $this->_cpuService = new CpuService($this->request); } return $this->_cpuService; } final public function getRamService(): RamService { if (!$this->_ramService) { $this->_ramService = new RamService($this->request); } return $this->_ramService; } final public function getDiskService(): DiskService { if (!$this->_diskService) { $this->_diskService = new DiskService($this->request); } return $this->_diskService; } protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string { switch ($action) { case 'index': $this->getHelper()->setViewDatas($this->getViewDatas()); $result = view($this->view_path . 'server' . DIRECTORY_SEPARATOR . $action, ['viewDatas' => $this->getViewDatas()]); break; default: $result = parent::getResultPageByActon($action, $message); break; } return $result; } //Index,FieldForm관련 protected function index_process(): array { $fields = [ 'fields' => ['code', 'type', 'model', 'price', "raid", 'status'], ]; $this->init('index', $fields); // $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임 $entities = []; foreach (parent::index_process() as $entity) { $entity->setPartEntities("CPU", $this->getCpuService()->getAdapterEntities($entity)); $entity->setPartEntities("RAM", $this->getRamService()->getAdapterEntities($entity)); $entity->setPartEntities("DISK", $this->getDiskService()->getAdapterEntities($entity)); $entities[] = $entity; } return $entities; } }