Example #1
0
 /**
  *
  * @return array
  */
 public function updateAction()
 {
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         $id = $this->getRequest()->getParam('id_incoterm');
         $incoterm = IncotermQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the Incoterm with id {$id}"));
         try {
             $this->getIncotermCatalog()->beginTransaction();
             IncotermFactory::populate($incoterm, $params);
             $this->getIncotermCatalog()->update($incoterm);
             $this->getIncotermCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el Incoterm"));
         } catch (Exception $e) {
             $this->getIncotermCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('incoterm/list');
 }
Example #2
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Incoterm
  */
 protected function makeBean($resultset)
 {
     return IncotermFactory::createFromArray($resultset);
 }