/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\ProductPriceList */ protected function makeBean($resultset) { return ProductPriceListFactory::createFromArray($resultset); }
/** * * @return array */ public function createAction() { $form = $this->getForm(); if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); if (!$form->isValid($params)) { $this->view->setTpl("New"); $this->view->form = $form; return; } try { $this->getProductPriceListCatalog()->beginTransaction(); $productPriceList = ProductPriceListFactory::createFromArray($form->getValues()); $this->getProductPriceListCatalog()->create($productPriceList); $this->newLogForCreate($productPriceList); $this->getProductPriceListCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se ha guardado correctamente el ")); } catch (Exception $e) { $this->getProductPriceListCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('price-list/list'); }