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