Esempio n. 1
0
 function updateSingleTransaction($session, $id)
 {
     $this->initServiceProxy($session);
     // get transaction item to update
     $transaction = $this->getItem($id);
     // build request
     $req = new GetItemTransactionsRequestType();
     $req->ItemID = $transaction['item_id'];
     $req->TransactionID = $transaction['transaction_id'];
     WPLE()->logger->info('ItemID: ' . $req->ItemID);
     WPLE()->logger->info('TransactionID: ' . $req->TransactionID);
     // $req->DetailLevel = $Facet_DetailLevelCodeType->ReturnAll;
     $req->setDetailLevel('ReturnAll');
     $req->setIncludeContainingOrder(true);
     // download the data
     $res = $this->_cs->GetItemTransactions($req);
     // handle response and check if successful
     if ($this->handleResponse($res)) {
         // since GetItemTransactions returns the Item object outside of the Transaction object,
         // we need to rearrange it before we pass it to handleTransactionType()
         $Transaction = $res->TransactionArray[0];
         $Transaction->Item = $res->Item;
         $this->handleTransactionType('TransactionType', $Transaction);
         WPLE()->logger->info(sprintf("Transaction %s updated successfully.", $req->TransactionID));
     } else {
         WPLE()->logger->error("Error on transactions update" . print_r($res, 1));
     }
 }