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