/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Family */ protected function makeBean($resultset) { return FamilyFactory::createFromArray($resultset); }
public function updateAction() { // Get id of family will be edit if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); $id = $this->getRequest()->getParam('id_family'); $family = FamilyQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Family with id {$id}")); try { $this->getFamilyCatalog()->beginTransaction(); $familyFactory = FamilyFactory::populate($family, $params); // Update family $this->getFamilyCatalog()->update($family); // Commit last change in database $this->getFamilyCatalog()->commit(); } catch (Exception $e) { // Roll back any change in database $this->getFamilyCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->setFlash("ok", $this->i18n->_("The Family with id {$id} was updated")); $this->_redirect('family/list'); }