Example #1
0
 /**
  *
  * @return array
  */
 public function updateAction()
 {
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $id = $this->getRequest()->getParam('id_respondent');
         $respondent = RespondentQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Respondent with id {$id}"));
         try {
             $this->getRespondentCatalog()->beginTransaction();
             RespondentFactory::populate($respondent, $params);
             $this->getRespondentCatalog()->update($respondent);
             $this->getRespondentCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el Respondent"));
         } catch (Exception $e) {
             $this->getRespondentCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('respondent/list');
 }
Example #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Respondent
  */
 protected function makeBean($resultset)
 {
     return RespondentFactory::createFromArray($resultset);
 }