/** * * @return array */ public function createAction() { if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); try { $this->getEventCatalog()->beginTransaction(); $event = EventFactory::createFromArray($params); $this->getEventCatalog()->create($event); $this->getEventCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se ha guardado correctamente el ")); } catch (Exception $e) { $this->getEventCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('event/list'); }
/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Event */ protected function makeBean($resultset) { return EventFactory::createFromArray($resultset); }