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