uri_path .= "cloudflare/"; // dd($this->uri_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 {} protected function sync_process_result($message): RedirectResponse|string { return redirect()->to($this->myauth->popPreviousUrl())->with('error', $message); } final protected function sync_procedure(string $uid): RedirectResponse { //Transaction Start $this->getService()->getModel()->transStart(); try { $this->sync_process($uid); if ($this->isMyLog) { MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["SUCCESS"], $this->myauth->getUIDByAuthInfo()); } $this->getService()->getModel()->transCommit(); return $this->sync_process_result(MESSAGES["SUCCESS"]); } catch (\Exception $e) { //Transaction Rollback $this->getService()->getModel()->transRollback(); if ($this->isMyLog) { MyLogService::add("error", $e->getMessage()); MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo()); } return redirect()->back()->with('error', $e->getMessage()); } } protected function reload_process(mixed $uid): void {} protected function reload_process_result($message): RedirectResponse|string { return redirect()->to($this->myauth->popPreviousUrl())->with('error', $message); } final protected function reload_procedure(mixed $uid): RedirectResponse { //Transaction Start $this->getService()->getModel()->transStart(); try { $this->reload_process($uid); if ($this->isMyLog) { MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["SUCCESS"], $this->myauth->getUIDByAuthInfo()); } $this->getService()->getModel()->transCommit(); return $this->reload_process_result(MESSAGES["SUCCESS"]); } catch (\Exception $e) { //Transaction Rollback $this->getService()->getModel()->transRollback(); if ($this->isMyLog) { MyLogService::add("error", $e->getMessage()); MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo()); } return redirect()->back()->with('error', $e->getMessage()); } } }