/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\Quarantine */ protected function makeBean($resultset) { return QuarantineFactory::createFromArray($resultset); }
/** * * @return array */ public function updateAction() { $form = $this->getForm(); if ($this->getRequest()->isPost()) { $params = $this->getRequest()->getParams(); if (!$form->isValid($params)) { $this->view->setTpl("New"); $this->view->form = $form; return; } $id = $this->getRequest()->getParam('id'); $quarantine = QuarantineQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Quarantine with id {$id}")); try { $this->getQuarantineCatalog()->beginTransaction(); QuarantineFactory::populate($quarantine, $form->getValues()); $this->getQuarantineCatalog()->update($quarantine); $this->getQuarantineCatalog()->commit(); $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el Quarantine")); } catch (Exception $e) { $this->getQuarantineCatalog()->rollBack(); $this->setFlash('error', $this->i18n->_($e->getMessage())); } } $this->_redirect('quarantine/list'); }