Exemplo n.º 1
0
 /**
  *
  * @return array
  */
 public function createAction()
 {
     $params = $this->getRequest()->getParams();
     //die('<pre>'.print_r($params, true).'</pre>');
     try {
         // Replace the object values with the new values
         $this->getRespondentCatalog()->beginTransaction();
         $respondent = RespondentFactory::createFromArray($params);
         $this->getRespondentCatalog()->create($respondent);
         // Commit last change in database
         $this->getRespondentCatalog()->commit();
         $this->setFlash("ok", $this->i18n->_("Respondent successfully created"));
     } catch (Exception $e) {
         // Roll back any change in database
         $this->getRespondentCatalog()->rollBack();
         $this->setFlash("error", $this->i18n->_($e->getMessage()));
     }
     $this->setFlash("ok", "Saved");
     return $this->_redirect('respondent/list');
 }
Exemplo n.º 2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Respondent
  */
 protected function makeBean($resultset)
 {
     return RespondentFactory::createFromArray($resultset);
 }