Ejemplo n.º 1
0
 /**
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\ProductGroup
  */
 protected function makeBean($resultset)
 {
     return ProductGroupFactory::createFromArray($resultset);
 }
Ejemplo n.º 2
0
 /**
  *
  * @return array
  */
 public function updateAction()
 {
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $id = $this->getRequest()->getParam('id');
         $productGroup = ProductGroupQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the ProductGroup with id {$id}"));
         try {
             $this->getProductGroupCatalog()->beginTransaction();
             ProductGroupFactory::populate($productGroup, $params);
             $this->getProductGroupCatalog()->update($productGroup);
             $this->getProductGroupCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("The Product Group was successfully updated"));
         } catch (Exception $e) {
             $this->getProductGroupCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('product-group/list');
 }