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