/** * * @return array */ public function updateAction() { if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); $id = $this->getRequest()->getParam('id_subfamily'); $subfamily = SubfamilyQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the subfamily with id {$id}")); try { $this->getSubfamilyCatalog()->beginTransaction(); SubfamilyFactory::populate($subfamily, $params); $this->getSubfamilyCatalog()->update($subfamily); $this->getSubfamilyCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("The Subfamily with id {$id} was updated")); } catch (Exception $e) { $this->getSubfamilyCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('subfamily/list'); }
/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Subfamily */ protected function makeBean($resultset) { return SubfamilyFactory::createFromArray($resultset); }