_viewDatas['user'] = $this->getUserModel()->getEntity([$this->getUserModel()->getPrimaryKey() => $this->_viewDatas['auth'][AUTH_FIELDS['ID']]]); return $entity; } final public function update_form($uid) { try { $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->_product = $this->getProductModel()->getEntity([$this->_model->getPrimaryKey() => $entity->product_uid]); $this->_viewDatas = $this->init(__FUNCTION__); $this->_viewDatas['entity'] = $this->update_form_process($entity); helper(['form']); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); return view($this->_viewPath . '/update', ['viewDatas' => $this->_viewDatas]); } catch (\Exception $e) { log_message("error", $e->getMessage()); return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage()); } } final public function update($uid) { $msg = ""; try { $entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); $this->_product = $this->getProductModel()->getEntity([$this->_model->getPrimaryKey() => $entity->product_uid]); $this->_viewDatas = $this->init(__FUNCTION__); $this->update_validate($entity); $entity = $this->update_process($entity); $msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 결제가 완료하였습니다."; return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/"); } catch (\Exception $e) { $msg = "{$this->_viewDatas['title']}에서 결제를 실패하였습니다.\n" . $e->getMessage(); log_message("error", $e->getMessage()); $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']); return redirect()->back()->withInput(); } finally { $this->_session->setFlashdata("return_message", $msg); } } }