コード例 #1
0
 /**
  *
  * @return array
  */
 public function updateAction()
 {
     $form = $this->getForm();
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         if (!$form->isValid($params)) {
             $this->view->setTpl("New");
             $this->view->form = $form;
             return;
         }
         $id = $this->getRequest()->getParam('id');
         $questionMatrixResponse = QuestionMatrixResponseQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the QuestionMatrixResponse with id {$id}"));
         try {
             $this->getQuestionMatrixResponseCatalog()->beginTransaction();
             QuestionMatrixResponseFactory::populate($questionMatrixResponse, $form->getValues());
             $this->getQuestionMatrixResponseCatalog()->update($questionMatrixResponse);
             $this->getQuestionMatrixResponseCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el QuestionMatrixResponse"));
         } catch (Exception $e) {
             $this->getQuestionMatrixResponseCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('question-matrix-response/list');
 }
コード例 #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\QuestionMatrixResponse
  */
 protected function makeBean($resultset)
 {
     return QuestionMatrixResponseFactory::createFromArray($resultset);
 }