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