示例#1
0
文件: Client.php 项目: stephlanj/mws
 /**
  * Convert SubmitFeedRequest to name value pairs
  * @param MarketplaceWebService_Model_SubmitFeedRequest $request
  * @return array
  */
 private function convertSubmitFeed($request)
 {
     $parameters = array();
     $parameters['Action'] = 'SubmitFeed';
     if ($request->isSetMarketplace()) {
         $parameters['Marketplace'] = $request->getMarketplace();
     }
     if ($request->isSetMerchant()) {
         $parameters['Merchant'] = $request->getMerchant();
     }
     if ($request->isSetMarketplaceIdList()) {
         $marketplaceIdList = $request->getMarketplaceIdList();
         foreach ($marketplaceIdList->getId() as $idIndex => $id) {
             $parameters['MarketplaceIdList.Id.' . ($idIndex + 1)] = $id;
         }
     }
     if ($request->isSetFeedType()) {
         $parameters['FeedType'] = $request->getFeedType();
     }
     if ($request->isSetPurgeAndReplace()) {
         $parameters['PurgeAndReplace'] = $request->getPurgeAndReplace() ? "true" : "false";
     }
     if ($request->isSetMWSAuthToken()) {
         $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
     }
     $headers = array();
     array_push($headers, "Content-Type: " . $request->getContentType()->toString());
     return array(CONVERTED_PARAMETERS_KEY => $parameters, CONVERTED_HEADERS_KEY => $headers);
 }