class_path = "Cloudflare/"; $this->uri_path .= strtolower($this->class_path); } final protected function getAuthModel(): AuthModel { if ($this->_authModel === null) { $this->_authModel = new AuthModel(); } return $this->_authModel; } final protected function getAccountModel(): AccountModel { if ($this->_accountModel === null) { $this->_accountModel = new AccountModel(); } return $this->_accountModel; } final protected function getZoneModel(): ZoneModel { if ($this->_zoneModel === null) { $this->_zoneModel = new ZoneModel(); } return $this->_zoneModel; } final protected function getRecordModel(): RecordModel { if ($this->_recordModel === null) { $this->_recordModel = new RecordModel(); } return $this->_recordModel; } protected function sync_process(string $uid): void {} final protected function sync_procedure(string $uid): RedirectResponse { //Transaction Start $this->getModel()->transStart(); try { $this->sync_process($uid); $this->message = "{$this->class_name}: 동기화작업을 완료하였습니다."; $this->getModel()->transCommit(); log_message("notice", __FUNCTION__ . $this->message); // 이전 URL로 리다이렉트 return redirect()->to($this->myauth->popPreviousUrl())->with('error', $this->message); } catch (\Exception $e) { //Transaction Rollback $this->getModel()->transRollback(); log_message("error", $e->getMessage()); return redirect()->back()->with('error', __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); } } protected function reload_process(mixed $uid): void {} final protected function reload_procedure(mixed $uid): RedirectResponse { //Transaction Start $this->getModel()->transStart(); try { $this->reload_process($uid); $this->message = "{$this->class_name}: Reload 작업이 완료되었습니다."; $this->getModel()->transCommit(); log_message("notice", __FUNCTION__ . $this->message); // 이전 URL로 리다이렉트 return redirect()->to($this->myauth->popPreviousUrl())->with('error', $this->message); } catch (\Exception $e) { //Transaction Rollback $this->getModel()->transRollback(); log_message("error", $e->getMessage()); return redirect()->back()->with('error', __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage()); } } //Trigger protected function trigger_process(mixed $uid): void {} final protected function trigger_procedure(mixed $uid): ResponseInterface { //Transaction Start $this->getModel()->transStart(); try { // 여기에 필요한 로직을 구현하세요 $this->trigger_process($uid); $this->message = "{$this->class_name}: Trigger 작업이 완료되었습니다."; $this->getModel()->transCommit(); log_message("notice", __FUNCTION__ . $this->message); return $this->response->setJSON(['status' => 200, $this->message], 200); } catch (\Exception $e) { //Transaction Rollback $this->getModel()->transRollback(); log_message("error", $e->getMessage()); return $this->response->setJSON(['status' => 500, 'message' => $e->getMessage()], 500); } } }