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