コード例 #1
0
 /**
  *
  * @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');
         $printingTechniqueSize = PrintingTechniqueSizeQuery::create()->findByPKOrThrow($id, $this->i18n->_("Not exists the PrintingTechniqueSize with id {$id}"));
         try {
             $this->getPrintingTechniqueSizeCatalog()->beginTransaction();
             PrintingTechniqueSizeFactory::populate($printingTechniqueSize, $form->getValues());
             $this->getPrintingTechniqueSizeCatalog()->update($printingTechniqueSize);
             $this->getPrintingTechniqueSizeCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el PrintingTechniqueSize"));
         } catch (Exception $e) {
             $this->getPrintingTechniqueSizeCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('printing-technique-size/list');
 }
コード例 #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\PrintingTechniqueSize
  */
 protected function makeBean($resultset)
 {
     return PrintingTechniqueSizeFactory::createFromArray($resultset);
 }