コード例 #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');
         $pollMatrixResponse = PollMatrixResponseQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the PollMatrixResponse with id {$id}"));
         try {
             $this->getPollMatrixResponseCatalog()->beginTransaction();
             PollMatrixResponseFactory::populate($pollMatrixResponse, $form->getValues());
             $this->getPollMatrixResponseCatalog()->update($pollMatrixResponse);
             $this->getPollMatrixResponseCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el PollMatrixResponse"));
         } catch (Exception $e) {
             $this->getPollMatrixResponseCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('poll-matrix-response/list');
 }
コード例 #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\PollMatrixResponse
  */
 protected function makeBean($resultset)
 {
     return PollMatrixResponseFactory::createFromArray($resultset);
 }