Beispiel #1
0
 /**
  *
  * @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');
         }
     }
 }
Beispiel #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Poll
  */
 protected function makeBean($resultset)
 {
     return PollFactory::createFromArray($resultset);
 }