/**
  *
  * @return array
  */
 public function createAction()
 {
     $form = $this->getForm();
     if ($this->getRequest()->isPost()) {
         $params = $this->getRequest()->getParams();
         if (!$form->isValid($params)) {
             $this->view->setTpl("New");
             $this->view->form = $form;
             return;
         }
         try {
             $this->getPurchaseOrderReceivedCatalog()->beginTransaction();
             $purchaseOrderReceived = PurchaseOrderReceivedFactory::createFromArray($form->getValues());
             $this->getPurchaseOrderReceivedCatalog()->create($purchaseOrderReceived);
             $this->getPurchaseOrderReceivedCatalog()->commit();
             $this->setFlash('ok', $this->i18n->_("Se ha guardado correctamente el "));
         } catch (Exception $e) {
             $this->getPurchaseOrderReceivedCatalog()->rollBack();
             $this->setFlash('error', $this->i18n->_($e->getMessage()));
         }
     }
     $this->_redirect('purchase-order-received/list');
 }
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\PurchaseOrderReceived
  */
 protected function makeBean($resultset)
 {
     return PurchaseOrderReceivedFactory::createFromArray($resultset);
 }