/** * * @return array */ public function createAction() { $form = $this->getForm(); if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); if (!$form->isValid($params)) { $this->view->setTpl("New"); $this->view->form = $form; return; } try { $this->getQuestionMatrixResponseCatalog()->beginTransaction(); $questionMatrixResponse = QuestionMatrixResponseFactory::createFromArray($form->getValues()); $this->getQuestionMatrixResponseCatalog()->create($questionMatrixResponse); $this->getQuestionMatrixResponseCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se ha guardado correctamente el ")); } catch (Exception $e) { $this->getQuestionMatrixResponseCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('question-matrix-response/list'); }
/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\QuestionMatrixResponse */ protected function makeBean($resultset) { return QuestionMatrixResponseFactory::createFromArray($resultset); }