/**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\PurchaseOrderReceived
  */
 protected function makeBean($resultset)
 {
     return PurchaseOrderReceivedFactory::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');
         $purchaseOrderReceived = PurchaseOrderReceivedQuery::create()->findByPKOrThrow($id, $this->i18n->_("It does not exist the PurchaseOrderReceived with id {$id}"));
         try {
             $this->getPurchaseOrderReceivedCatalog()->beginTransaction();
             PurchaseOrderReceivedFactory::populate($purchaseOrderReceived, $form->getValues());
             $this->getPurchaseOrderReceivedCatalog()->update($purchaseOrderReceived);
             $this->getPurchaseOrderReceivedCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se actualizo correctamente el PurchaseOrderReceived"));
         } catch (Exception $e) {
             $this->getPurchaseOrderReceivedCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('purchase-order-received/list');
 }