/** * * @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->getPurchaseOrderFolioCatalog()->beginTransaction(); $purchaseOrderFolio = PurchaseOrderFolioFactory::createFromArray($form->getValues()); $this->getPurchaseOrderFolioCatalog()->create($purchaseOrderFolio); $this->getPurchaseOrderFolioCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se ha guardado correctamente el ")); } catch (Exception $e) { $this->getPurchaseOrderFolioCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('purchase-order-folio/list'); }
/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\PurchaseOrderFolio */ protected function makeBean($resultset) { return PurchaseOrderFolioFactory::createFromArray($resultset); }