/** * * @return array */ public function createAction() { if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); try { $this->getPollCatalog()->beginTransaction(); $poll = PollFactory::createFromArray($params); $this->getPollCatalog()->create($poll); $this->getPollCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("You can create questions now")); $this->_redirect('poll/makequestionary/id/' . $poll->getIdPoll() . '/type/make'); } catch (Exception $e) { $this->getPollCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); $this->_redirect('poll/list'); } } }
/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Poll */ protected function makeBean($resultset) { return PollFactory::createFromArray($resultset); }