/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Country */ protected function makeBean($resultset) { return CountryFactory::createFromArray($resultset); }
/** * * @return array */ public function updateAction() { if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); $id = $this->getRequest()->getParam('Code'); $country = CountryQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Country with id {$id}")); try { $this->getCountryCatalog()->beginTransaction(); CountryFactory::populate($country, $params); $this->getCountryCatalog()->update($country); $this->getCountryCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el Country")); } catch (Exception $e) { $this->getCountryCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('country/list'); }