title = lang("{$this->getService()->getClassPath()}.title"); $this->helper = new MapurlHelper(); } protected function getService(): MapurlService { if ($this->service === null) { $this->service = new MapurlService(); $this->class_name = $this->service->getClassName(); $this->class_path = $this->service->getClassPath(); } return $this->service; } private function remaping_process(): void { //모든 필요한 FormOption등 조기화작업 필요 $this->getService()->getModel()->where('status', DEFAULTS['STATUS']); $this->getService()->getModel()->orderBy('oldurl', 'ASC'); $this->entitys = $this->getService()->getModel()->getEntitys(); $remap_page = view($this->view_path . DIRECTORY_SEPARATOR . strtolower($this->getService()->getClassPath()) . DIRECTORY_SEPARATOR . 'remap_template', ["viewDatas" => $this->getViewDatas()]); $remap_path = FCPATH . DIRECTORY_SEPARATOR . "mapurl"; //디렉토리 생성 여부 확인 if (!is_dir($remap_path)) { mkdir($remap_path, 0755, true); } //htmlBuild용 if (!file_put_contents($remap_path . '/index.html', $remap_page)) { throw new \Exception(__FUNCTION__ . "에서 " . $remap_path . "/index.html Write 실패"); } } //생성 protected function create_init(string $action, $fields = []): void { $fields = [ 'fields' => [$this->getService()->getModel()::TITLE, 'newurl', 'status'], ]; parent::create_init($action, fields: $fields); } protected function create_process(): void { parent::create_process(); $this->remaping_process(); } //수정,단일필드작업,일괄처리작업 공통 protected function modify_process(mixed $uid): void { parent::modify_process($uid); $this->remaping_process(); } //삭제,일괄삭제 공통 protected function delete_process(mixed $uid): void { parent::delete_process($uid); $this->remaping_process(); } }