repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
CPIGroup/phpAmazonMWS
includes/classes/AmazonMerchantServiceList.php
AmazonMerchantServiceList.setDetailsByCreator
public function setDetailsByCreator(AmazonMerchantShipmentCreator $obj) { $this->resetDetails(); $options = $obj->getOptions(); foreach($options as $op=>$val){ if(preg_match("#ShipmentRequestDetails#",$op)){ $this->options[$op] = $val; } } }
php
public function setDetailsByCreator(AmazonMerchantShipmentCreator $obj) { $this->resetDetails(); $options = $obj->getOptions(); foreach($options as $op=>$val){ if(preg_match("#ShipmentRequestDetails#",$op)){ $this->options[$op] = $val; } } }
[ "public", "function", "setDetailsByCreator", "(", "AmazonMerchantShipmentCreator", "$", "obj", ")", "{", "$", "this", "->", "resetDetails", "(", ")", ";", "$", "options", "=", "$", "obj", "->", "getOptions", "(", ")", ";", "foreach", "(", "$", "options", "...
Sets all of the same Shipment details used by the given Amazon Merchant Shipment Creator object. @param AmazonMerchantShipmentCreator $obj <p>Shipment Creator object with options already set</p>
[ "Sets", "all", "of", "the", "same", "Shipment", "details", "used", "by", "the", "given", "Amazon", "Merchant", "Shipment", "Creator", "object", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonMerchantServiceList.php#L430-L439
CPIGroup/phpAmazonMWS
includes/classes/AmazonMerchantServiceList.php
AmazonMerchantServiceList.resetDetails
protected function resetDetails() { foreach($this->options as $op=>$junk){ if(preg_match("#ShipmentRequestDetails#",$op)){ unset($this->options[$op]); } } }
php
protected function resetDetails() { foreach($this->options as $op=>$junk){ if(preg_match("#ShipmentRequestDetails#",$op)){ unset($this->options[$op]); } } }
[ "protected", "function", "resetDetails", "(", ")", "{", "foreach", "(", "$", "this", "->", "options", "as", "$", "op", "=>", "$", "junk", ")", "{", "if", "(", "preg_match", "(", "\"#ShipmentRequestDetails#\"", ",", "$", "op", ")", ")", "{", "unset", "(...
Resets the shipment detail options. Since shipment details are required parameters, these options should not be removed without replacing them, so this method is not public.
[ "Resets", "the", "shipment", "detail", "options", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonMerchantServiceList.php#L447-L453
CPIGroup/phpAmazonMWS
includes/classes/AmazonMerchantServiceList.php
AmazonMerchantServiceList.fetchServices
public function fetchServices(){ if (!array_key_exists('ShipmentRequestDetails.AmazonOrderId',$this->options)){ $this->log("Amazon Order ID must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ItemList.Item.1.OrderItemId',$this->options)){ $this->log("Items must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShipFromAddress.Name',$this->options)){ $this->log("Shipping Address must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.PackageDimensions.Length',$this->options) && !array_key_exists('ShipmentRequestDetails.PackageDimensions.PredefinedPackageDimensions',$this->options)){ $this->log("Package Dimensions must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.Weight.Value',$this->options)){ $this->log("Weight must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience',$this->options)){ $this->log("Delivery Experience must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp',$this->options)){ $this->log("Carrier Pick-Up Option must be set in order to fetch a service list",'Warning'); return false; } $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); $path = $this->options['Action'].'Result'; if ($this->mockMode){ $xml = $this->fetchMockFile()->$path; } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $xml = simplexml_load_string($response['body'])->$path; } $this->parseXML($xml); }
php
public function fetchServices(){ if (!array_key_exists('ShipmentRequestDetails.AmazonOrderId',$this->options)){ $this->log("Amazon Order ID must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ItemList.Item.1.OrderItemId',$this->options)){ $this->log("Items must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShipFromAddress.Name',$this->options)){ $this->log("Shipping Address must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.PackageDimensions.Length',$this->options) && !array_key_exists('ShipmentRequestDetails.PackageDimensions.PredefinedPackageDimensions',$this->options)){ $this->log("Package Dimensions must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.Weight.Value',$this->options)){ $this->log("Weight must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience',$this->options)){ $this->log("Delivery Experience must be set in order to fetch a service list",'Warning'); return false; } if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp',$this->options)){ $this->log("Carrier Pick-Up Option must be set in order to fetch a service list",'Warning'); return false; } $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); $path = $this->options['Action'].'Result'; if ($this->mockMode){ $xml = $this->fetchMockFile()->$path; } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $xml = simplexml_load_string($response['body'])->$path; } $this->parseXML($xml); }
[ "public", "function", "fetchServices", "(", ")", "{", "if", "(", "!", "array_key_exists", "(", "'ShipmentRequestDetails.AmazonOrderId'", ",", "$", "this", "->", "options", ")", ")", "{", "$", "this", "->", "log", "(", "\"Amazon Order ID must be set in order to fetch...
Fetches a list of eligible shipping Services from Amazon. Submits a <i>GetEligibleShippingServices</i> request to Amazon. Amazon will send one to three lists back as a response, which can be retrieved using <i>getServiceList</i>. Other methods are available for fetching specific values from the valid services list. The following parameters are required: Amazon order ID, item list, shipping address, package dimensions, shipment weight, delivery experience option, and carrier pick-up option. @return boolean <b>FALSE</b> if something goes wrong
[ "Fetches", "a", "list", "of", "eligible", "shipping", "Services", "from", "Amazon", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonMerchantServiceList.php#L465-L514
CPIGroup/phpAmazonMWS
includes/classes/AmazonMerchantServiceList.php
AmazonMerchantServiceList.parseXML
protected function parseXML($xml){ $this->serviceList = array(); $this->downList = array(); $this->termsList = array(); if (!$xml){ return false; } if (isset($xml->ShippingServiceList)) { $i = 0; foreach($xml->ShippingServiceList->children() as $key=>$x){ if ($key != 'ShippingService'){ break; } $this->serviceList[$i]['ShippingServiceName'] = (string)$x->ShippingServiceName; $this->serviceList[$i]['CarrierName'] = (string)$x->CarrierName; $this->serviceList[$i]['ShippingServiceId'] = (string)$x->ShippingServiceId; $this->serviceList[$i]['ShippingServiceOfferId'] = (string)$x->ShippingServiceOfferId; $this->serviceList[$i]['ShipDate'] = (string)$x->ShipDate; if (isset($x->EarliestEstimatedDeliveryDate)) { $this->serviceList[$i]['EarliestEstimatedDeliveryDate'] = (string)$x->EarliestEstimatedDeliveryDate; } if (isset($x->LatestEstimatedDeliveryDate)) { $this->serviceList[$i]['LatestEstimatedDeliveryDate'] = (string)$x->LatestEstimatedDeliveryDate; } $this->serviceList[$i]['Rate']['Amount'] = (string)$x->Rate->Amount; $this->serviceList[$i]['Rate']['CurrencyCode'] = (string)$x->Rate->CurrencyCode; $this->serviceList[$i]['ShippingServiceOptions']['DeliveryExperience'] = (string)$x->ShippingServiceOptions->DeliveryExperience; $this->serviceList[$i]['ShippingServiceOptions']['CarrierWillPickUp'] = (string)$x->ShippingServiceOptions->CarrierWillPickUp; if (isset($x->ShippingServiceOptions->DeclaredValue)) { $this->serviceList[$i]['ShippingServiceOptions']['DeclaredValue']['Amount'] = (string)$x->ShippingServiceOptions->DeclaredValue->Amount; $this->serviceList[$i]['ShippingServiceOptions']['DeclaredValue']['CurrencyCode'] = (string)$x->ShippingServiceOptions->DeclaredValue->CurrencyCode; } if (isset($x->AvailableLabelFormats)) { foreach ($x->AvailableLabelFormats as $z) { $this->serviceList[$i]['AvailableLabelFormats'][] = (string)$z; } } $i++; } } if (isset($xml->TemporarilyUnavailableCarrierList)) { $i = 0; foreach($xml->TemporarilyUnavailableCarrierList->children() as $key=>$x){ if ($key != 'TemporarilyUnavailableCarrier'){ break; } $this->downList[$i] = (string)$x->CarrierName; $i++; } } if (isset($xml->TermsAndConditionsNotAcceptedCarrierList)) { $i = 0; foreach($xml->TermsAndConditionsNotAcceptedCarrierList->children() as $key=>$x){ if ($key != 'TermsAndConditionsNotAcceptedCarrier'){ break; } $this->termsList[$i] = (string)$x->CarrierName; $i++; } } }
php
protected function parseXML($xml){ $this->serviceList = array(); $this->downList = array(); $this->termsList = array(); if (!$xml){ return false; } if (isset($xml->ShippingServiceList)) { $i = 0; foreach($xml->ShippingServiceList->children() as $key=>$x){ if ($key != 'ShippingService'){ break; } $this->serviceList[$i]['ShippingServiceName'] = (string)$x->ShippingServiceName; $this->serviceList[$i]['CarrierName'] = (string)$x->CarrierName; $this->serviceList[$i]['ShippingServiceId'] = (string)$x->ShippingServiceId; $this->serviceList[$i]['ShippingServiceOfferId'] = (string)$x->ShippingServiceOfferId; $this->serviceList[$i]['ShipDate'] = (string)$x->ShipDate; if (isset($x->EarliestEstimatedDeliveryDate)) { $this->serviceList[$i]['EarliestEstimatedDeliveryDate'] = (string)$x->EarliestEstimatedDeliveryDate; } if (isset($x->LatestEstimatedDeliveryDate)) { $this->serviceList[$i]['LatestEstimatedDeliveryDate'] = (string)$x->LatestEstimatedDeliveryDate; } $this->serviceList[$i]['Rate']['Amount'] = (string)$x->Rate->Amount; $this->serviceList[$i]['Rate']['CurrencyCode'] = (string)$x->Rate->CurrencyCode; $this->serviceList[$i]['ShippingServiceOptions']['DeliveryExperience'] = (string)$x->ShippingServiceOptions->DeliveryExperience; $this->serviceList[$i]['ShippingServiceOptions']['CarrierWillPickUp'] = (string)$x->ShippingServiceOptions->CarrierWillPickUp; if (isset($x->ShippingServiceOptions->DeclaredValue)) { $this->serviceList[$i]['ShippingServiceOptions']['DeclaredValue']['Amount'] = (string)$x->ShippingServiceOptions->DeclaredValue->Amount; $this->serviceList[$i]['ShippingServiceOptions']['DeclaredValue']['CurrencyCode'] = (string)$x->ShippingServiceOptions->DeclaredValue->CurrencyCode; } if (isset($x->AvailableLabelFormats)) { foreach ($x->AvailableLabelFormats as $z) { $this->serviceList[$i]['AvailableLabelFormats'][] = (string)$z; } } $i++; } } if (isset($xml->TemporarilyUnavailableCarrierList)) { $i = 0; foreach($xml->TemporarilyUnavailableCarrierList->children() as $key=>$x){ if ($key != 'TemporarilyUnavailableCarrier'){ break; } $this->downList[$i] = (string)$x->CarrierName; $i++; } } if (isset($xml->TermsAndConditionsNotAcceptedCarrierList)) { $i = 0; foreach($xml->TermsAndConditionsNotAcceptedCarrierList->children() as $key=>$x){ if ($key != 'TermsAndConditionsNotAcceptedCarrier'){ break; } $this->termsList[$i] = (string)$x->CarrierName; $i++; } } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "$", "this", "->", "serviceList", "=", "array", "(", ")", ";", "$", "this", "->", "downList", "=", "array", "(", ")", ";", "$", "this", "->", "termsList", "=", "array", "(", ")", ";", ...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonMerchantServiceList.php#L523-L587
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.setShippingSpeeds
public function setShippingSpeeds($s){ if (is_string($s)){ $this->resetShippingSpeeds(); $this->options['ShippingSpeedCategories.1'] = $s; } else if (is_array($s)){ $this->resetShippingSpeeds(); $i = 1; foreach ($s as $x){ $this->options['ShippingSpeedCategories.'.$i] = $x; $i++; } } else { return false; } }
php
public function setShippingSpeeds($s){ if (is_string($s)){ $this->resetShippingSpeeds(); $this->options['ShippingSpeedCategories.1'] = $s; } else if (is_array($s)){ $this->resetShippingSpeeds(); $i = 1; foreach ($s as $x){ $this->options['ShippingSpeedCategories.'.$i] = $x; $i++; } } else { return false; } }
[ "public", "function", "setShippingSpeeds", "(", "$", "s", ")", "{", "if", "(", "is_string", "(", "$", "s", ")", ")", "{", "$", "this", "->", "resetShippingSpeeds", "(", ")", ";", "$", "this", "->", "options", "[", "'ShippingSpeedCategories.1'", "]", "=",...
Sets the preferred shipping speeds. (Optional) This method sets the shipping speed to be sent in the next request. @param string|array $s <p>"Standard", "Expedited", or "Priority", or an array of these values</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "preferred", "shipping", "speeds", ".", "(", "Optional", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L178-L192
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.resetShippingSpeeds
public function resetShippingSpeeds(){ foreach($this->options as $op=>$junk){ if(preg_match("#ShippingSpeedCategories#",$op)){ unset($this->options[$op]); } } }
php
public function resetShippingSpeeds(){ foreach($this->options as $op=>$junk){ if(preg_match("#ShippingSpeedCategories#",$op)){ unset($this->options[$op]); } } }
[ "public", "function", "resetShippingSpeeds", "(", ")", "{", "foreach", "(", "$", "this", "->", "options", "as", "$", "op", "=>", "$", "junk", ")", "{", "if", "(", "preg_match", "(", "\"#ShippingSpeedCategories#\"", ",", "$", "op", ")", ")", "{", "unset",...
Removes shipping speed options. Use this in case you change your mind and want to remove the shipping speed parameters you previously set.
[ "Removes", "shipping", "speed", "options", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L200-L206
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.setIncludeCod
public function setIncludeCod($s = 'true') { if (filter_var($s, FILTER_VALIDATE_BOOLEAN)) { $s = 'true'; } else { $s = 'false'; } $this->options['IncludeCODFulfillmentPreview'] = $s; }
php
public function setIncludeCod($s = 'true') { if (filter_var($s, FILTER_VALIDATE_BOOLEAN)) { $s = 'true'; } else { $s = 'false'; } $this->options['IncludeCODFulfillmentPreview'] = $s; }
[ "public", "function", "setIncludeCod", "(", "$", "s", "=", "'true'", ")", "{", "if", "(", "filter_var", "(", "$", "s", ",", "FILTER_VALIDATE_BOOLEAN", ")", ")", "{", "$", "s", "=", "'true'", ";", "}", "else", "{", "$", "s", "=", "'false'", ";", "}"...
Sets the option for getting previews that are for COD (Cash On Delivery). (Optional) If this option is set, Amazon will give previews for COD in addition to the normal previews. If this option is not set or is set to FALSE, Amazon will not give previews that are for COD. @param boolean $s [optional] <p>Defaults to TRUE</p>
[ "Sets", "the", "option", "for", "getting", "previews", "that", "are", "for", "COD", "(", "Cash", "On", "Delivery", ")", ".", "(", "Optional", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L215-L222
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.setIncludeDeliveryWindows
public function setIncludeDeliveryWindows($s = 'true') { if (filter_var($s, FILTER_VALIDATE_BOOLEAN)) { $s = 'true'; } else { $s = 'false'; } $this->options['IncludeDeliveryWindows'] = $s; }
php
public function setIncludeDeliveryWindows($s = 'true') { if (filter_var($s, FILTER_VALIDATE_BOOLEAN)) { $s = 'true'; } else { $s = 'false'; } $this->options['IncludeDeliveryWindows'] = $s; }
[ "public", "function", "setIncludeDeliveryWindows", "(", "$", "s", "=", "'true'", ")", "{", "if", "(", "filter_var", "(", "$", "s", ",", "FILTER_VALIDATE_BOOLEAN", ")", ")", "{", "$", "s", "=", "'true'", ";", "}", "else", "{", "$", "s", "=", "'false'", ...
Sets the option for getting delivery window data in the fetched previews. (Optional) If this option is set, Amazon will give delivery window data for applicable order previews. If this option is not set or is set to FALSE, Amazon will not give delivery window data. @param boolean $s [optional] <p>Defaults to TRUE</p>
[ "Sets", "the", "option", "for", "getting", "delivery", "window", "data", "in", "the", "fetched", "previews", ".", "(", "Optional", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L231-L238
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.parseXML
protected function parseXML($xml) { if (!$xml){ return false; } $i = 0; foreach($xml->children() as $x){ $this->previewList[$i]['ShippingSpeedCategory'] = (string)$x->ShippingSpeedCategory; $this->previewList[$i]['IsFulfillable'] = (string)$x->IsFulfillable; $this->previewList[$i]['IsCODCapable'] = (string)$x->IsCODCapable; $this->previewList[$i]['MarketplaceId'] = (string)$x->MarketplaceId; if (isset($x->EstimatedShippingWeight)){ $this->previewList[$i]['EstimatedShippingWeight']['Unit'] = (string)$x->EstimatedShippingWeight->Unit; $this->previewList[$i]['EstimatedShippingWeight']['Value'] = (string)$x->EstimatedShippingWeight->Value; } if (isset($x->FulfillmentPreviewShipments)){ $j = 0; foreach ($x->FulfillmentPreviewShipments->children() as $y){ $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['LatestShipDate'] = (string)$y->LatestShipDate; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['LatestArrivalDate'] = (string)$y->LatestArrivalDate; $k = 0; foreach ($y->FulfillmentPreviewItems->children() as $z){ $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['EstimatedShippingWeight']['Unit'] = (string)$z->EstimatedShippingWeight->Unit; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['EstimatedShippingWeight']['Value'] = (string)$z->EstimatedShippingWeight->Value; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['SellerSKU'] = (string)$z->SellerSKU; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['SellerFulfillmentOrderItemId'] = (string)$z->SellerFulfillmentOrderItemId; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['ShippingWeightCalculationMethod'] = (string)$z->ShippingWeightCalculationMethod; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['Quantity'] = (string)$z->Quantity; $k++; } $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['EarliestShipDate'] = (string)$y->EarliestShipDate; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['EarliestArrivalDate'] = (string)$y->EarliestArrivalDate; $j++; } } if (isset($x->EstimatedFees)){ $j = 0; foreach ($x->EstimatedFees->children() as $y){ $this->previewList[$i]['EstimatedFees'][$j]['CurrencyCode'] = (string)$y->Amount->CurrencyCode; $this->previewList[$i]['EstimatedFees'][$j]['Value'] = (string)$y->Amount->Value; $this->previewList[$i]['EstimatedFees'][$j]['Name'] = (string)$y->Name; $j++; } } if (isset($x->UnfulfillablePreviewItems)){ $j = 0; foreach ($x->UnfulfillablePreviewItems->children() as $y){ $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['SellerSKU'] = (string)$y->SellerSKU; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['SellerFulfillmentOrderItemId'] = (string)$y->SellerFulfillmentOrderItemId; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['Quantity'] = (string)$y->Quantity; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['ItemUnfulfillableReasons'] = (string)$y->ItemUnfulfillableReasons; $j++; } } if (isset($x->OrderUnfulfillableReasons)){ $j = 0; foreach ($x->OrderUnfulfillableReasons->children() as $y){ $this->previewList[$i]['OrderUnfulfillableReasons'][$j] = (string)$y; $j++; } } if (isset($x->ScheduledDeliveryInfo)){ $this->previewList[$i]['ScheduledDeliveryInfo']['DeliveryTimeZone'] = (string)$x->ScheduledDeliveryInfo->DeliveryTimeZone; foreach ($x->ScheduledDeliveryInfo->DeliveryWindows->children() as $y){ $temp = array(); $temp['StartDateTime'] = (string)$y->DeliveryWindow->StartDateTime; $temp['EndDateTime'] = (string)$y->DeliveryWindow->EndDateTime; $this->previewList[$i]['ScheduledDeliveryInfo']['DeliveryWindows'][] = $temp; } } $i++; } }
php
protected function parseXML($xml) { if (!$xml){ return false; } $i = 0; foreach($xml->children() as $x){ $this->previewList[$i]['ShippingSpeedCategory'] = (string)$x->ShippingSpeedCategory; $this->previewList[$i]['IsFulfillable'] = (string)$x->IsFulfillable; $this->previewList[$i]['IsCODCapable'] = (string)$x->IsCODCapable; $this->previewList[$i]['MarketplaceId'] = (string)$x->MarketplaceId; if (isset($x->EstimatedShippingWeight)){ $this->previewList[$i]['EstimatedShippingWeight']['Unit'] = (string)$x->EstimatedShippingWeight->Unit; $this->previewList[$i]['EstimatedShippingWeight']['Value'] = (string)$x->EstimatedShippingWeight->Value; } if (isset($x->FulfillmentPreviewShipments)){ $j = 0; foreach ($x->FulfillmentPreviewShipments->children() as $y){ $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['LatestShipDate'] = (string)$y->LatestShipDate; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['LatestArrivalDate'] = (string)$y->LatestArrivalDate; $k = 0; foreach ($y->FulfillmentPreviewItems->children() as $z){ $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['EstimatedShippingWeight']['Unit'] = (string)$z->EstimatedShippingWeight->Unit; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['EstimatedShippingWeight']['Value'] = (string)$z->EstimatedShippingWeight->Value; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['SellerSKU'] = (string)$z->SellerSKU; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['SellerFulfillmentOrderItemId'] = (string)$z->SellerFulfillmentOrderItemId; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['ShippingWeightCalculationMethod'] = (string)$z->ShippingWeightCalculationMethod; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['FulfillmentPreviewItems'][$k]['Quantity'] = (string)$z->Quantity; $k++; } $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['EarliestShipDate'] = (string)$y->EarliestShipDate; $this->previewList[$i]['FulfillmentPreviewShipments'][$j]['EarliestArrivalDate'] = (string)$y->EarliestArrivalDate; $j++; } } if (isset($x->EstimatedFees)){ $j = 0; foreach ($x->EstimatedFees->children() as $y){ $this->previewList[$i]['EstimatedFees'][$j]['CurrencyCode'] = (string)$y->Amount->CurrencyCode; $this->previewList[$i]['EstimatedFees'][$j]['Value'] = (string)$y->Amount->Value; $this->previewList[$i]['EstimatedFees'][$j]['Name'] = (string)$y->Name; $j++; } } if (isset($x->UnfulfillablePreviewItems)){ $j = 0; foreach ($x->UnfulfillablePreviewItems->children() as $y){ $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['SellerSKU'] = (string)$y->SellerSKU; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['SellerFulfillmentOrderItemId'] = (string)$y->SellerFulfillmentOrderItemId; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['Quantity'] = (string)$y->Quantity; $this->previewList[$i]['UnfulfillablePreviewItems'][$j]['ItemUnfulfillableReasons'] = (string)$y->ItemUnfulfillableReasons; $j++; } } if (isset($x->OrderUnfulfillableReasons)){ $j = 0; foreach ($x->OrderUnfulfillableReasons->children() as $y){ $this->previewList[$i]['OrderUnfulfillableReasons'][$j] = (string)$y; $j++; } } if (isset($x->ScheduledDeliveryInfo)){ $this->previewList[$i]['ScheduledDeliveryInfo']['DeliveryTimeZone'] = (string)$x->ScheduledDeliveryInfo->DeliveryTimeZone; foreach ($x->ScheduledDeliveryInfo->DeliveryWindows->children() as $y){ $temp = array(); $temp['StartDateTime'] = (string)$y->DeliveryWindow->StartDateTime; $temp['EndDateTime'] = (string)$y->DeliveryWindow->EndDateTime; $this->previewList[$i]['ScheduledDeliveryInfo']['DeliveryWindows'][] = $temp; } } $i++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "i", "=", "0", ";", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "x", ")", "{", "$",...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L288-L360
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.getPreview
public function getPreview($i = null){ if (!isset($this->previewList)){ return false; } if (is_numeric($i)){ return $this->previewList[$i]; } else { return $this->previewList; } }
php
public function getPreview($i = null){ if (!isset($this->previewList)){ return false; } if (is_numeric($i)){ return $this->previewList[$i]; } else { return $this->previewList; } }
[ "public", "function", "getPreview", "(", "$", "i", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "previewList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", ")", "{", "return",...
Returns the specified fulfillment preview, or all of them. This method will return <b>FALSE</b> if the list has not yet been filled. The array for a single fulfillment order will have the following fields: <ul> <li><b>ShippingSpeedCategory</b> - "Standard", "Expedited", or "Priority"</li> <li><b>IsFulfillable</b> - "true" or "false"</li> <li><b>IsCODCapable</b> - "true" or "false"</li> <li><b>MarketplaceId</b> - marketplace ID</li> <li><b>EstimatedShippingWeight</b> (optional) - an array with the fields <b>Unit</b> and <b>Value</b></li> <li><b>FulfillmentPreviewShipments</b> (optional)- array of shipments:</li> <ul> <li><b>EarliestShipDate</b> - ISO 8601 date format</li> <li><b>LatestShipDate</b> - ISO 8601 date format</li> <li><b>EarliestArrivalDate</b> - ISO 8601 date format</li> <li><b>LatestArrivalDate</b> - ISO 8601 date format</li> <li><b>FulfillmentPreviewItems</b> - array of items</li> <ul> <li><b>SellerSKU</b> - SKU</li> <li><b>SellerFulfillmentOrderItemId</b> - unique ID for the item</li> <li><b>Quantity</b> - quantity in the shipment</li> <li><b>EstimatedShippingWeight</b> - an array with the fields <b>Unit</b> and <b>Value</b></li> <li><b>ShippingWeightCalculationMethod</b> - "Package" or "Dimensional"</li> </ul> </ul> <li><b>EstimatedFees</b> (optional)- array of fees</li> <ul> <li><b>Name</b> - name of the fee</li> <li><b>CurrencyCode</b> - currency for the fee</li> <li><b>Value</b> - value for the fee</li> </ul> <li><b>UnfulfillablePreviewItems</b> (optional)- array of items</li> <ul> <li><b>SellerSKU</b> - SKU</li> <li><b>SellerFulfillmentOrderItemId</b> - unique ID for the item</li> <li><b>Quantity</b> - quantity of the item</li> <li><b>ItemUnfulfillableReasons</b> - message as to why the item is unfulfillable</li> </ul> <li><b>OrderUnfulfillableReasons</b> (optional)- array of message strings</li> <li><b>ScheduledDeliveryInfo</b> (optional)- time zone and array of delivery windows</li> <ul> <li><b>DeliveryTimeZone</b> - IANA time zone name</li> <li><b>DeliveryWindows</b> - array of delivery windows</li> <ul> <li><b>StartDateTime</b> - ISO 8601 date format</li> <li><b>EndDateTime</b> - ISO 8601 date format</li> </ul> </ul> </ul> @param int $i [optional] <p>List index to retrieve the value from. If none is given, the entire list will be returned. Defaults to NULL.</p> @return array|boolean array, multi-dimensional array, or <b>FALSE</b> if list not filled yet
[ "Returns", "the", "specified", "fulfillment", "preview", "or", "all", "of", "them", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L416-L425
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentPreview.php
AmazonFulfillmentPreview.getEstimatedWeight
public function getEstimatedWeight($i = 0,$mode = 0){ if (!isset($this->previewList)){ return false; } if (is_int($i) && $i >= 0){ if ($mode == 1){ return $this->previewList[$i]['EstimatedShippingWeight']['Unit']; } else if ($mode == 2){ return $this->previewList[$i]['EstimatedShippingWeight']; } else { return $this->previewList[$i]['EstimatedShippingWeight']['Value']; } } else { return false; } }
php
public function getEstimatedWeight($i = 0,$mode = 0){ if (!isset($this->previewList)){ return false; } if (is_int($i) && $i >= 0){ if ($mode == 1){ return $this->previewList[$i]['EstimatedShippingWeight']['Unit']; } else if ($mode == 2){ return $this->previewList[$i]['EstimatedShippingWeight']; } else { return $this->previewList[$i]['EstimatedShippingWeight']['Value']; } } else { return false; } }
[ "public", "function", "getEstimatedWeight", "(", "$", "i", "=", "0", ",", "$", "mode", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "previewList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", ...
Returns the estimated shipping weight for the specified entry. The mode can be set to change what is returned: 0 = value, 1 = unit, 2 = value & unit @param int $i [optional]<p>List index to retrieve the value from. Defaults to 0.</p> @param int $mode [optional]<p>The type of value to return. Defaults to only value.</p> @return string|boolean weight value, or <b>FALSE</b> if improper input
[ "Returns", "the", "estimated", "shipping", "weight", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentPreview.php#L435-L451
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.fetchItems
public function fetchItems($r = true){ $this->prepareToken(); $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); $path = $this->options['Action'].'Result'; if ($this->mockMode){ $xml = $this->fetchMockFile()->$path; } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $xml = simplexml_load_string($response['body'])->$path; } if (is_null($xml->AmazonOrderId)){ $this->log("You just got throttled.",'Warning'); return false; } $this->orderId = (string)$xml->AmazonOrderId; if (!empty($this->options['AmazonOrderId']) && $this->options['AmazonOrderId'] != $this->orderId){ $this->log('You grabbed the wrong Order\'s items! - '.$this->options['AmazonOrderId'].' =/= '.$this->orderId,'Urgent'); } $this->parseXML($xml->OrderItems); $this->checkToken($xml); if ($this->tokenFlag && $this->tokenUseFlag && $r === true){ while ($this->tokenFlag){ $this->log("Recursively fetching more items"); $this->fetchItems(false); } } }
php
public function fetchItems($r = true){ $this->prepareToken(); $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); $path = $this->options['Action'].'Result'; if ($this->mockMode){ $xml = $this->fetchMockFile()->$path; } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $xml = simplexml_load_string($response['body'])->$path; } if (is_null($xml->AmazonOrderId)){ $this->log("You just got throttled.",'Warning'); return false; } $this->orderId = (string)$xml->AmazonOrderId; if (!empty($this->options['AmazonOrderId']) && $this->options['AmazonOrderId'] != $this->orderId){ $this->log('You grabbed the wrong Order\'s items! - '.$this->options['AmazonOrderId'].' =/= '.$this->orderId,'Urgent'); } $this->parseXML($xml->OrderItems); $this->checkToken($xml); if ($this->tokenFlag && $this->tokenUseFlag && $r === true){ while ($this->tokenFlag){ $this->log("Recursively fetching more items"); $this->fetchItems(false); } } }
[ "public", "function", "fetchItems", "(", "$", "r", "=", "true", ")", "{", "$", "this", "->", "prepareToken", "(", ")", ";", "$", "url", "=", "$", "this", "->", "urlbase", ".", "$", "this", "->", "urlbranch", ";", "$", "query", "=", "$", "this", "...
Retrieves the items from Amazon. Submits a <i>ListOrderItems</i> request to Amazon. In order to do this, an Amazon order ID is required. Amazon will send the data back as a response, which can be retrieved using <i>getItems</i>. Other methods are available for fetching specific values from the order. This operation can potentially involve tokens. @param boolean $r [optional] <p>When set to <b>FALSE</b>, the function will not recurse, defaults to <b>TRUE</b></p> @return boolean <b>FALSE</b> if something goes wrong
[ "Retrieves", "the", "items", "from", "Amazon", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L121-L160
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $item){ $n = $this->index; $this->itemList[$n]['ASIN'] = (string)$item->ASIN; $this->itemList[$n]['SellerSKU'] = (string)$item->SellerSKU; $this->itemList[$n]['OrderItemId'] = (string)$item->OrderItemId; $this->itemList[$n]['Title'] = (string)$item->Title; $this->itemList[$n]['QuantityOrdered'] = (string)$item->QuantityOrdered; if (isset($item->QuantityShipped)){ $this->itemList[$n]['QuantityShipped'] = (string)$item->QuantityShipped; } if (isset($item->BuyerCustomizedInfo->CustomizedURL)){ $this->itemList[$n]['BuyerCustomizedInfo'] = (string)$item->BuyerCustomizedInfo->CustomizedURL; } if (isset($item->PointsGranted)){ $this->itemList[$n]['PointsGranted']['PointsNumber'] = (string)$item->PointsGranted->PointsNumber; $this->itemList[$n]['PointsGranted']['Amount'] = (string)$item->PointsGranted->PointsMonetaryValue->Amount; $this->itemList[$n]['PointsGranted']['CurrencyCode'] = (string)$item->PointsGranted->PointsMonetaryValue->CurrencyCode; } if (isset($item->PriceDesignation)){ $this->itemList[$n]['PriceDesignation'] = (string)$item->PriceDesignation; } if (isset($item->GiftMessageText)){ $this->itemList[$n]['GiftMessageText'] = (string)$item->GiftMessageText; } if (isset($item->GiftWrapLevel)){ $this->itemList[$n]['GiftWrapLevel'] = (string)$item->GiftWrapLevel; } if (isset($item->ItemPrice)){ $this->itemList[$n]['ItemPrice']['Amount'] = (string)$item->ItemPrice->Amount; $this->itemList[$n]['ItemPrice']['CurrencyCode'] = (string)$item->ItemPrice->CurrencyCode; } if (isset($item->ShippingPrice)){ $this->itemList[$n]['ShippingPrice']['Amount'] = (string)$item->ShippingPrice->Amount; $this->itemList[$n]['ShippingPrice']['CurrencyCode'] = (string)$item->ShippingPrice->CurrencyCode; } if (isset($item->GiftWrapPrice)){ $this->itemList[$n]['GiftWrapPrice']['Amount'] = (string)$item->GiftWrapPrice->Amount; $this->itemList[$n]['GiftWrapPrice']['CurrencyCode'] = (string)$item->GiftWrapPrice->CurrencyCode; } if (isset($item->ItemTax)){ $this->itemList[$n]['ItemTax']['Amount'] = (string)$item->ItemTax->Amount; $this->itemList[$n]['ItemTax']['CurrencyCode'] = (string)$item->ItemTax->CurrencyCode; } if (isset($item->ShippingTax)){ $this->itemList[$n]['ShippingTax']['Amount'] = (string)$item->ShippingTax->Amount; $this->itemList[$n]['ShippingTax']['CurrencyCode'] = (string)$item->ShippingTax->CurrencyCode; } if (isset($item->GiftWrapTax)){ $this->itemList[$n]['GiftWrapTax']['Amount'] = (string)$item->GiftWrapTax->Amount; $this->itemList[$n]['GiftWrapTax']['CurrencyCode'] = (string)$item->GiftWrapTax->CurrencyCode; } if (isset($item->ShippingDiscount)){ $this->itemList[$n]['ShippingDiscount']['Amount'] = (string)$item->ShippingDiscount->Amount; $this->itemList[$n]['ShippingDiscount']['CurrencyCode'] = (string)$item->ShippingDiscount->CurrencyCode; } if (isset($item->PromotionDiscount)){ $this->itemList[$n]['PromotionDiscount']['Amount'] = (string)$item->PromotionDiscount->Amount; $this->itemList[$n]['PromotionDiscount']['CurrencyCode'] = (string)$item->PromotionDiscount->CurrencyCode; } if (isset($item->CODFee)){ $this->itemList[$n]['CODFee']['Amount'] = (string)$item->CODFee->Amount; $this->itemList[$n]['CODFee']['CurrencyCode'] = (string)$item->CODFee->CurrencyCode; } if (isset($item->CODFeeDiscount)){ $this->itemList[$n]['CODFeeDiscount']['Amount'] = (string)$item->CODFeeDiscount->Amount; $this->itemList[$n]['CODFeeDiscount']['CurrencyCode'] = (string)$item->CODFeeDiscount->CurrencyCode; } if (isset($item->PromotionIds)){ $i = 0; foreach($item->PromotionIds->children() as $x){ $this->itemList[$n]['PromotionIds'][$i] = (string)$x; $i++; } } if (isset($item->InvoiceData)){ if (isset($item->InvoiceData->InvoiceRequirement)){ $this->itemList[$n]['InvoiceData']['InvoiceRequirement'] = (string)$item->InvoiceData->InvoiceRequirement; } if (isset($item->InvoiceData->BuyerSelectedInvoiceCategory)){ $this->itemList[$n]['InvoiceData']['BuyerSelectedInvoiceCategory'] = (string)$item->InvoiceData->BuyerSelectedInvoiceCategory; } if (isset($item->InvoiceData->InvoiceTitle)){ $this->itemList[$n]['InvoiceData']['InvoiceTitle'] = (string)$item->InvoiceData->InvoiceTitle; } if (isset($item->InvoiceData->InvoiceInformation)){ $this->itemList[$n]['InvoiceData']['InvoiceInformation'] = (string)$item->InvoiceData->InvoiceInformation; } } if (isset($item->ConditionId)){ $this->itemList[$n]['ConditionId'] = (string)$item->ConditionId; } if (isset($item->ConditionSubtypeId)){ $this->itemList[$n]['ConditionSubtypeId'] = (string)$item->ConditionSubtypeId; } if (isset($item->ConditionNote)){ $this->itemList[$n]['ConditionNote'] = (string)$item->ConditionNote; } if (isset($item->ScheduledDeliveryStartDate)){ $this->itemList[$n]['ScheduledDeliveryStartDate'] = (string)$item->ScheduledDeliveryStartDate; } if (isset($item->ScheduledDeliveryEndDate)){ $this->itemList[$n]['ScheduledDeliveryEndDate'] = (string)$item->ScheduledDeliveryEndDate; } $this->index++; } }
php
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $item){ $n = $this->index; $this->itemList[$n]['ASIN'] = (string)$item->ASIN; $this->itemList[$n]['SellerSKU'] = (string)$item->SellerSKU; $this->itemList[$n]['OrderItemId'] = (string)$item->OrderItemId; $this->itemList[$n]['Title'] = (string)$item->Title; $this->itemList[$n]['QuantityOrdered'] = (string)$item->QuantityOrdered; if (isset($item->QuantityShipped)){ $this->itemList[$n]['QuantityShipped'] = (string)$item->QuantityShipped; } if (isset($item->BuyerCustomizedInfo->CustomizedURL)){ $this->itemList[$n]['BuyerCustomizedInfo'] = (string)$item->BuyerCustomizedInfo->CustomizedURL; } if (isset($item->PointsGranted)){ $this->itemList[$n]['PointsGranted']['PointsNumber'] = (string)$item->PointsGranted->PointsNumber; $this->itemList[$n]['PointsGranted']['Amount'] = (string)$item->PointsGranted->PointsMonetaryValue->Amount; $this->itemList[$n]['PointsGranted']['CurrencyCode'] = (string)$item->PointsGranted->PointsMonetaryValue->CurrencyCode; } if (isset($item->PriceDesignation)){ $this->itemList[$n]['PriceDesignation'] = (string)$item->PriceDesignation; } if (isset($item->GiftMessageText)){ $this->itemList[$n]['GiftMessageText'] = (string)$item->GiftMessageText; } if (isset($item->GiftWrapLevel)){ $this->itemList[$n]['GiftWrapLevel'] = (string)$item->GiftWrapLevel; } if (isset($item->ItemPrice)){ $this->itemList[$n]['ItemPrice']['Amount'] = (string)$item->ItemPrice->Amount; $this->itemList[$n]['ItemPrice']['CurrencyCode'] = (string)$item->ItemPrice->CurrencyCode; } if (isset($item->ShippingPrice)){ $this->itemList[$n]['ShippingPrice']['Amount'] = (string)$item->ShippingPrice->Amount; $this->itemList[$n]['ShippingPrice']['CurrencyCode'] = (string)$item->ShippingPrice->CurrencyCode; } if (isset($item->GiftWrapPrice)){ $this->itemList[$n]['GiftWrapPrice']['Amount'] = (string)$item->GiftWrapPrice->Amount; $this->itemList[$n]['GiftWrapPrice']['CurrencyCode'] = (string)$item->GiftWrapPrice->CurrencyCode; } if (isset($item->ItemTax)){ $this->itemList[$n]['ItemTax']['Amount'] = (string)$item->ItemTax->Amount; $this->itemList[$n]['ItemTax']['CurrencyCode'] = (string)$item->ItemTax->CurrencyCode; } if (isset($item->ShippingTax)){ $this->itemList[$n]['ShippingTax']['Amount'] = (string)$item->ShippingTax->Amount; $this->itemList[$n]['ShippingTax']['CurrencyCode'] = (string)$item->ShippingTax->CurrencyCode; } if (isset($item->GiftWrapTax)){ $this->itemList[$n]['GiftWrapTax']['Amount'] = (string)$item->GiftWrapTax->Amount; $this->itemList[$n]['GiftWrapTax']['CurrencyCode'] = (string)$item->GiftWrapTax->CurrencyCode; } if (isset($item->ShippingDiscount)){ $this->itemList[$n]['ShippingDiscount']['Amount'] = (string)$item->ShippingDiscount->Amount; $this->itemList[$n]['ShippingDiscount']['CurrencyCode'] = (string)$item->ShippingDiscount->CurrencyCode; } if (isset($item->PromotionDiscount)){ $this->itemList[$n]['PromotionDiscount']['Amount'] = (string)$item->PromotionDiscount->Amount; $this->itemList[$n]['PromotionDiscount']['CurrencyCode'] = (string)$item->PromotionDiscount->CurrencyCode; } if (isset($item->CODFee)){ $this->itemList[$n]['CODFee']['Amount'] = (string)$item->CODFee->Amount; $this->itemList[$n]['CODFee']['CurrencyCode'] = (string)$item->CODFee->CurrencyCode; } if (isset($item->CODFeeDiscount)){ $this->itemList[$n]['CODFeeDiscount']['Amount'] = (string)$item->CODFeeDiscount->Amount; $this->itemList[$n]['CODFeeDiscount']['CurrencyCode'] = (string)$item->CODFeeDiscount->CurrencyCode; } if (isset($item->PromotionIds)){ $i = 0; foreach($item->PromotionIds->children() as $x){ $this->itemList[$n]['PromotionIds'][$i] = (string)$x; $i++; } } if (isset($item->InvoiceData)){ if (isset($item->InvoiceData->InvoiceRequirement)){ $this->itemList[$n]['InvoiceData']['InvoiceRequirement'] = (string)$item->InvoiceData->InvoiceRequirement; } if (isset($item->InvoiceData->BuyerSelectedInvoiceCategory)){ $this->itemList[$n]['InvoiceData']['BuyerSelectedInvoiceCategory'] = (string)$item->InvoiceData->BuyerSelectedInvoiceCategory; } if (isset($item->InvoiceData->InvoiceTitle)){ $this->itemList[$n]['InvoiceData']['InvoiceTitle'] = (string)$item->InvoiceData->InvoiceTitle; } if (isset($item->InvoiceData->InvoiceInformation)){ $this->itemList[$n]['InvoiceData']['InvoiceInformation'] = (string)$item->InvoiceData->InvoiceInformation; } } if (isset($item->ConditionId)){ $this->itemList[$n]['ConditionId'] = (string)$item->ConditionId; } if (isset($item->ConditionSubtypeId)){ $this->itemList[$n]['ConditionSubtypeId'] = (string)$item->ConditionSubtypeId; } if (isset($item->ConditionNote)){ $this->itemList[$n]['ConditionNote'] = (string)$item->ConditionNote; } if (isset($item->ScheduledDeliveryStartDate)){ $this->itemList[$n]['ScheduledDeliveryStartDate'] = (string)$item->ScheduledDeliveryStartDate; } if (isset($item->ScheduledDeliveryEndDate)){ $this->itemList[$n]['ScheduledDeliveryEndDate'] = (string)$item->ScheduledDeliveryEndDate; } $this->index++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "item", ")", "{", "$", "n", "=", "$", "this", ...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L190-L302
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getItems
public function getItems($i = null){ if (isset($this->itemList)){ if (is_numeric($i)){ return $this->itemList[$i]; } else { return $this->itemList; } } else { return false; } }
php
public function getItems($i = null){ if (isset($this->itemList)){ if (is_numeric($i)){ return $this->itemList[$i]; } else { return $this->itemList; } } else { return false; } }
[ "public", "function", "getItems", "(", "$", "i", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", ")", ")", "{", "if", "(", "is_numeric", "(", "$", "i", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", ...
Returns the specified order item, or all of them. This method will return <b>FALSE</b> if the list has not yet been filled. The array for a single order item will have the following fields: <ul> <li><b>ASIN</b> - the ASIN for the item</li> <li><b>SellerSKU</b> - the SKU for the item</li> <li><b>OrderItemId</b> - the unique ID for the order item</li> <li><b>Title</b> - the name of the item</li> <li><b>QuantityOrdered</b> - the quantity of the item ordered</li> <li><b>QuantityShipped</b> (optional) - the quantity of the item shipped</li> <li><b>GiftMessageText</b> (optional) - gift message for the item</li> <li><b>GiftWrapLevel</b> (optional) - the type of gift wrapping for the item</li> <li><b>ItemPrice</b> (optional) - price for the item, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>ShippingPrice</b> (optional) - price for shipping, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>GiftWrapPrice</b> (optional) - price for gift wrapping, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>ItemTax</b> (optional) - tax on the item, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>ShippingTax</b> (optional) - tax on shipping, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>GiftWrapTax</b> (optional) - tax on gift wrapping, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>ShippingDiscount</b> (optional) - discount on shipping, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>PromotionDiscount</b> (optional) -promotional discount, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>CODFee</b> (optional) -fee charged for COD service, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>CODFeeDiscount</b> (optional) -discount on COD fee, array with the fields <b>Amount</b> and <b>CurrencyCode</b></li> <li><b>PromotionIds</b> (optional) -array of promotion IDs</li> </ul> @param int $i [optional] <p>List index to retrieve the value from. If none is given, the entire list will be returned. Defaults to NULL.</p> @return array|boolean array, multi-dimensional array, or <b>FALSE</b> if list not filled yet
[ "Returns", "the", "specified", "order", "item", "or", "all", "of", "them", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L348-L358
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getASIN
public function getASIN($i = 0){ if (isset($this->itemList[$i]['ASIN'])){ return $this->itemList[$i]['ASIN']; } else { return false; } }
php
public function getASIN($i = 0){ if (isset($this->itemList[$i]['ASIN'])){ return $this->itemList[$i]['ASIN']; } else { return false; } }
[ "public", "function", "getASIN", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ASIN'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", "i", "]", "[...
Returns the ASIN for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "ASIN", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L367-L374
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getOrderItemId
public function getOrderItemId($i = 0){ if (isset($this->itemList[$i]['OrderItemId'])){ return $this->itemList[$i]['OrderItemId']; } else { return false; } }
php
public function getOrderItemId($i = 0){ if (isset($this->itemList[$i]['OrderItemId'])){ return $this->itemList[$i]['OrderItemId']; } else { return false; } }
[ "public", "function", "getOrderItemId", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'OrderItemId'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", "i...
Returns the order item ID for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "order", "item", "ID", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L398-L404
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getTitle
public function getTitle($i = 0){ if (isset($this->itemList[$i]['Title'])){ return $this->itemList[$i]['Title']; } else { return false; } }
php
public function getTitle($i = 0){ if (isset($this->itemList[$i]['Title'])){ return $this->itemList[$i]['Title']; } else { return false; } }
[ "public", "function", "getTitle", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'Title'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", "i", "]", ...
Returns the name for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "name", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L413-L419
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getQuantityOrdered
public function getQuantityOrdered($i = 0){ if (isset($this->itemList[$i]['QuantityOrdered'])){ return $this->itemList[$i]['QuantityOrdered']; } else { return false; } }
php
public function getQuantityOrdered($i = 0){ if (isset($this->itemList[$i]['QuantityOrdered'])){ return $this->itemList[$i]['QuantityOrdered']; } else { return false; } }
[ "public", "function", "getQuantityOrdered", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'QuantityOrdered'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "...
Returns the quantity ordered for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "quantity", "ordered", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L428-L434
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getQuantityShipped
public function getQuantityShipped($i = 0){ if (isset($this->itemList[$i]['QuantityShipped'])){ return $this->itemList[$i]['QuantityShipped']; } else { return false; } }
php
public function getQuantityShipped($i = 0){ if (isset($this->itemList[$i]['QuantityShipped'])){ return $this->itemList[$i]['QuantityShipped']; } else { return false; } }
[ "public", "function", "getQuantityShipped", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'QuantityShipped'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "...
Returns the quantity shipped for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "quantity", "shipped", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L443-L449
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getCustomizedInfo
public function getCustomizedInfo($i = 0){ if (isset($this->itemList[$i]['BuyerCustomizedInfo'])){ return $this->itemList[$i]['BuyerCustomizedInfo']; } else { return false; } }
php
public function getCustomizedInfo($i = 0){ if (isset($this->itemList[$i]['BuyerCustomizedInfo'])){ return $this->itemList[$i]['BuyerCustomizedInfo']; } else { return false; } }
[ "public", "function", "getCustomizedInfo", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'BuyerCustomizedInfo'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", ...
Returns the URL for the ZIP file containing the customized options for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "URL", "for", "the", "ZIP", "file", "containing", "the", "customized", "options", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L458-L464
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getPointsGranted
public function getPointsGranted($i = 0, $only = false){ if (isset($this->itemList[$i]['PointsGranted'])){ if ($only){ return $this->itemList[$i]['PointsGranted']['PointsNumber']; } else { return $this->itemList[$i]['PointsGranted']; } } else { return false; } }
php
public function getPointsGranted($i = 0, $only = false){ if (isset($this->itemList[$i]['PointsGranted'])){ if ($only){ return $this->itemList[$i]['PointsGranted']['PointsNumber']; } else { return $this->itemList[$i]['PointsGranted']; } } else { return false; } }
[ "public", "function", "getPointsGranted", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'PointsGranted'", "]", ")", ")", "{", "if", "(", "$", ...
Returns the number of Amazon Points granted for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>PointsNumber</b>, <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the number of points</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "number", "of", "Amazon", "Points", "granted", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L475-L485
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getPriceDesignation
public function getPriceDesignation($i = 0){ if (isset($this->itemList[$i]['PriceDesignation'])){ return $this->itemList[$i]['PriceDesignation']; } else { return false; } }
php
public function getPriceDesignation($i = 0){ if (isset($this->itemList[$i]['PriceDesignation'])){ return $this->itemList[$i]['PriceDesignation']; } else { return false; } }
[ "public", "function", "getPriceDesignation", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'PriceDesignation'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", ...
Returns the price designation for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "price", "designation", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L494-L500
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getPercentShipped
public function getPercentShipped($i = 0){ if (!$this->getQuantityOrdered($i) || !$this->getQuantityShipped($i)){ return false; } if (isset($this->itemList[$i]['QuantityOrdered']) && isset($this->itemList[$i]['QuantityShipped'])){ return $this->itemList[$i]['QuantityShipped']/$this->itemList[$i]['QuantityOrdered']; } else { return false; } }
php
public function getPercentShipped($i = 0){ if (!$this->getQuantityOrdered($i) || !$this->getQuantityShipped($i)){ return false; } if (isset($this->itemList[$i]['QuantityOrdered']) && isset($this->itemList[$i]['QuantityShipped'])){ return $this->itemList[$i]['QuantityShipped']/$this->itemList[$i]['QuantityOrdered']; } else { return false; } }
[ "public", "function", "getPercentShipped", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "$", "this", "->", "getQuantityOrdered", "(", "$", "i", ")", "||", "!", "$", "this", "->", "getQuantityShipped", "(", "$", "i", ")", ")", "{", "return", "...
Returns the seller SKU for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return float|boolean decimal number from 0 to 1, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "seller", "SKU", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L509-L518
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getGiftMessageText
public function getGiftMessageText($i = 0){ if (isset($this->itemList[$i]['GiftMessageText'])){ return $this->itemList[$i]['GiftMessageText']; } else { return false; } }
php
public function getGiftMessageText($i = 0){ if (isset($this->itemList[$i]['GiftMessageText'])){ return $this->itemList[$i]['GiftMessageText']; } else { return false; } }
[ "public", "function", "getGiftMessageText", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'GiftMessageText'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "...
Returns the gift message text for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "gift", "message", "text", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L527-L533
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getGiftWrapLevel
public function getGiftWrapLevel($i = 0){ if (isset($this->itemList[$i]['GiftWrapLevel'])){ return $this->itemList[$i]['GiftWrapLevel']; } else { return false; } }
php
public function getGiftWrapLevel($i = 0){ if (isset($this->itemList[$i]['GiftWrapLevel'])){ return $this->itemList[$i]['GiftWrapLevel']; } else { return false; } }
[ "public", "function", "getGiftWrapLevel", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'GiftWrapLevel'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", ...
Returns the gift wrap level for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "gift", "wrap", "level", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L542-L548
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getItemPrice
public function getItemPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['ItemPrice'])){ if ($only){ return $this->itemList[$i]['ItemPrice']['Amount']; } else { return $this->itemList[$i]['ItemPrice']; } } else { return false; } }
php
public function getItemPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['ItemPrice'])){ if ($only){ return $this->itemList[$i]['ItemPrice']['Amount']; } else { return $this->itemList[$i]['ItemPrice']; } } else { return false; } }
[ "public", "function", "getItemPrice", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ItemPrice'", "]", ")", ")", "{", "if", "(", "$", "only",...
Returns the item price for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "item", "price", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L559-L569
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getShippingPrice
public function getShippingPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingPrice'])){ if ($only){ return $this->itemList[$i]['ShippingPrice']['Amount']; } else { return $this->itemList[$i]['ShippingPrice']; } } else { return false; } }
php
public function getShippingPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingPrice'])){ if ($only){ return $this->itemList[$i]['ShippingPrice']['Amount']; } else { return $this->itemList[$i]['ShippingPrice']; } } else { return false; } }
[ "public", "function", "getShippingPrice", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ShippingPrice'", "]", ")", ")", "{", "if", "(", "$", ...
Returns the shipping price for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "shipping", "price", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L580-L590
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getGiftWrapPrice
public function getGiftWrapPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['GiftWrapPrice'])){ if ($only){ return $this->itemList[$i]['GiftWrapPrice']['Amount']; } else { return $this->itemList[$i]['GiftWrapPrice']; } } else { return false; } }
php
public function getGiftWrapPrice($i = 0, $only = false){ if (isset($this->itemList[$i]['GiftWrapPrice'])){ if ($only){ return $this->itemList[$i]['GiftWrapPrice']['Amount']; } else { return $this->itemList[$i]['GiftWrapPrice']; } } else { return false; } }
[ "public", "function", "getGiftWrapPrice", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'GiftWrapPrice'", "]", ")", ")", "{", "if", "(", "$", ...
Returns the gift wrap price for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "gift", "wrap", "price", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L601-L611
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getItemTax
public function getItemTax($i = 0, $only = false){ if (isset($this->itemList[$i]['ItemTax'])){ if ($only){ return $this->itemList[$i]['ItemTax']['Amount']; } else { return $this->itemList[$i]['ItemTax']; } } else { return false; } }
php
public function getItemTax($i = 0, $only = false){ if (isset($this->itemList[$i]['ItemTax'])){ if ($only){ return $this->itemList[$i]['ItemTax']['Amount']; } else { return $this->itemList[$i]['ItemTax']; } } else { return false; } }
[ "public", "function", "getItemTax", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ItemTax'", "]", ")", ")", "{", "if", "(", "$", "only", "...
Returns the item tax for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "item", "tax", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L622-L632
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getShippingTax
public function getShippingTax($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingTax'])){ if ($only){ return $this->itemList[$i]['ShippingTax']['Amount']; } else { return $this->itemList[$i]['ShippingTax']; } } else { return false; } }
php
public function getShippingTax($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingTax'])){ if ($only){ return $this->itemList[$i]['ShippingTax']['Amount']; } else { return $this->itemList[$i]['ShippingTax']; } } else { return false; } }
[ "public", "function", "getShippingTax", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ShippingTax'", "]", ")", ")", "{", "if", "(", "$", "on...
Returns the shipping tax for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "shipping", "tax", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L643-L653
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getGiftWrapTax
public function getGiftWrapTax($i = 0, $only = false){ if (isset($this->itemList[$i]['GiftWrapTax'])){ if ($only){ return $this->itemList[$i]['GiftWrapTax']['Amount']; } else { return $this->itemList[$i]['GiftWrapTax']; } } else { return false; } }
php
public function getGiftWrapTax($i = 0, $only = false){ if (isset($this->itemList[$i]['GiftWrapTax'])){ if ($only){ return $this->itemList[$i]['GiftWrapTax']['Amount']; } else { return $this->itemList[$i]['GiftWrapTax']; } } else { return false; } }
[ "public", "function", "getGiftWrapTax", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'GiftWrapTax'", "]", ")", ")", "{", "if", "(", "$", "on...
Returns the gift wrap tax for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "gift", "wrap", "tax", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L664-L674
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getShippingDiscount
public function getShippingDiscount($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingDiscount'])){ if ($only){ return $this->itemList[$i]['ShippingDiscount']['Amount']; } else { return $this->itemList[$i]['ShippingDiscount']; } } else { return false; } }
php
public function getShippingDiscount($i = 0, $only = false){ if (isset($this->itemList[$i]['ShippingDiscount'])){ if ($only){ return $this->itemList[$i]['ShippingDiscount']['Amount']; } else { return $this->itemList[$i]['ShippingDiscount']; } } else { return false; } }
[ "public", "function", "getShippingDiscount", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ShippingDiscount'", "]", ")", ")", "{", "if", "(", ...
Returns the shipping discount for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "shipping", "discount", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L685-L695
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getPromotionDiscount
public function getPromotionDiscount($i = 0, $only = false){ if (isset($this->itemList[$i]['PromotionDiscount'])){ if ($only){ return $this->itemList[$i]['PromotionDiscount']['Amount']; } else { return $this->itemList[$i]['PromotionDiscount']; } } else { return false; } }
php
public function getPromotionDiscount($i = 0, $only = false){ if (isset($this->itemList[$i]['PromotionDiscount'])){ if ($only){ return $this->itemList[$i]['PromotionDiscount']['Amount']; } else { return $this->itemList[$i]['PromotionDiscount']; } } else { return false; } }
[ "public", "function", "getPromotionDiscount", "(", "$", "i", "=", "0", ",", "$", "only", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'PromotionDiscount'", "]", ")", ")", "{", "if", "(", ...
Returns the promotional discount for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If an array is returned, it will have the fields <b>Amount</b> and <b>CurrencyCode</b>. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param boolean $only [optional] <p>set to <b>TRUE</b> to get only the amount</p> @return array|string|boolean array, single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "promotional", "discount", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L706-L716
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getPromotionIds
public function getPromotionIds($i = 0, $j = null){ if (isset($this->itemList[$i]['PromotionIds'])){ if (isset($this->itemList[$i]['PromotionIds'][$j])){ return $this->itemList[$i]['PromotionIds'][$j]; } else { return $this->itemList[$i]['PromotionIds']; } } else { return false; } }
php
public function getPromotionIds($i = 0, $j = null){ if (isset($this->itemList[$i]['PromotionIds'])){ if (isset($this->itemList[$i]['PromotionIds'][$j])){ return $this->itemList[$i]['PromotionIds'][$j]; } else { return $this->itemList[$i]['PromotionIds']; } } else { return false; } }
[ "public", "function", "getPromotionIds", "(", "$", "i", "=", "0", ",", "$", "j", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'PromotionIds'", "]", ")", ")", "{", "if", "(", "isset", "...
Returns specified promotion ID for the specified item. This method will return the entire list of Promotion IDs if <i>$j</i> is not set. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param int $j [optional] <p>Second list index to retrieve the value from. Defaults to NULL.</p> @return array|string|boolean array, single value, or <b>FALSE</b> if incorrect index
[ "Returns", "specified", "promotion", "ID", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L726-L736
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getInvoiceData
public function getInvoiceData($i = 0){ if (isset($this->itemList[$i]['InvoiceData'])){ return $this->itemList[$i]['InvoiceData']; } else { return false; } }
php
public function getInvoiceData($i = 0){ if (isset($this->itemList[$i]['InvoiceData'])){ return $this->itemList[$i]['InvoiceData']; } else { return false; } }
[ "public", "function", "getInvoiceData", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'InvoiceData'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", "i...
Returns invoice data for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. The array for invoice data may have the following fields: <ul> <li><b>InvoiceRequirement</b> - invoice requirement information</li> <li><b>BuyerSelectedInvoiceCategory</b> - invoice category information selected by the buyer</li> <li><b>InvoiceTitle</b> - the title of the invoice as specified by the buyer</li> <li><b>InvoiceInformation</b> - additional invoice information</li> </ul> @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return array|boolean array, or <b>FALSE</b> if incorrect index
[ "Returns", "invoice", "data", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L752-L758
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getConditionId
public function getConditionId($i = 0){ if (isset($this->itemList[$i]['ConditionId'])){ return $this->itemList[$i]['ConditionId']; } else { return false; } }
php
public function getConditionId($i = 0){ if (isset($this->itemList[$i]['ConditionId'])){ return $this->itemList[$i]['ConditionId']; } else { return false; } }
[ "public", "function", "getConditionId", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ConditionId'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", "i...
Returns the condition for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. Possible values for the condition ID are... <ul> <li>New</li> <li>Used</li> <li>Collectible</li> <li>Refurbished</li> <li>Preorder</li> <li>Club</li> </ul> @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if incorrect index
[ "Returns", "the", "condition", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L776-L782
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getConditionSubtypeId
public function getConditionSubtypeId($i = 0){ if (isset($this->itemList[$i]['ConditionSubtypeId'])){ return $this->itemList[$i]['ConditionSubtypeId']; } else { return false; } }
php
public function getConditionSubtypeId($i = 0){ if (isset($this->itemList[$i]['ConditionSubtypeId'])){ return $this->itemList[$i]['ConditionSubtypeId']; } else { return false; } }
[ "public", "function", "getConditionSubtypeId", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ConditionSubtypeId'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[...
Returns the subcondition for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. Possible values for the subcondition ID are... <ul> <li>New</li> <li>Mint</li> <li>Very Good</li> <li>Good</li> <li>Acceptable</li> <li>Poor</li> <li>Club</li> <li>OEM</li> <li>Warranty</li> <li>Refurbished Warranty</li> <li>Refurbished</li> <li>Open Box</li> <li>Any</li> <li>Other</li> </ul> @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if incorrect index
[ "Returns", "the", "subcondition", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L808-L814
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getConditionNote
public function getConditionNote($i = 0){ if (isset($this->itemList[$i]['ConditionNote'])){ return $this->itemList[$i]['ConditionNote']; } else { return false; } }
php
public function getConditionNote($i = 0){ if (isset($this->itemList[$i]['ConditionNote'])){ return $this->itemList[$i]['ConditionNote']; } else { return false; } }
[ "public", "function", "getConditionNote", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ConditionNote'", "]", ")", ")", "{", "return", "$", "this", "->", "itemList", "[", "$", ...
Returns the condition description for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if incorrect index
[ "Returns", "the", "condition", "description", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L823-L829
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getScheduledDeliveryStartDate
public function getScheduledDeliveryStartDate($i = 0){ if (isset($this->itemList[$i]['ScheduledDeliveryStartDate'])){ return $this->itemList[$i]['ScheduledDeliveryStartDate']; } else { return false; } }
php
public function getScheduledDeliveryStartDate($i = 0){ if (isset($this->itemList[$i]['ScheduledDeliveryStartDate'])){ return $this->itemList[$i]['ScheduledDeliveryStartDate']; } else { return false; } }
[ "public", "function", "getScheduledDeliveryStartDate", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ScheduledDeliveryStartDate'", "]", ")", ")", "{", "return", "$", "this", "->", ...
Returns the earliest date in the scheduled delivery window for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if incorrect index
[ "Returns", "the", "earliest", "date", "in", "the", "scheduled", "delivery", "window", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L838-L844
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrderItemList.php
AmazonOrderItemList.getScheduledDeliveryEndDate
public function getScheduledDeliveryEndDate($i = 0){ if (isset($this->itemList[$i]['ScheduledDeliveryEndDate'])){ return $this->itemList[$i]['ScheduledDeliveryEndDate']; } else { return false; } }
php
public function getScheduledDeliveryEndDate($i = 0){ if (isset($this->itemList[$i]['ScheduledDeliveryEndDate'])){ return $this->itemList[$i]['ScheduledDeliveryEndDate']; } else { return false; } }
[ "public", "function", "getScheduledDeliveryEndDate", "(", "$", "i", "=", "0", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "itemList", "[", "$", "i", "]", "[", "'ScheduledDeliveryEndDate'", "]", ")", ")", "{", "return", "$", "this", "->", "ite...
Returns the latest date in the scheduled delivery window for the specified item. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if incorrect index
[ "Returns", "the", "latest", "date", "in", "the", "scheduled", "delivery", "window", "for", "the", "specified", "item", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrderItemList.php#L853-L859
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.setOrderFilter
public function setOrderFilter($s){ if ($s && is_string($s)) { $this->resetFilters(); $this->options['AmazonOrderId'] = $s; } else { return false; } }
php
public function setOrderFilter($s){ if ($s && is_string($s)) { $this->resetFilters(); $this->options['AmazonOrderId'] = $s; } else { return false; } }
[ "public", "function", "setOrderFilter", "(", "$", "s", ")", "{", "if", "(", "$", "s", "&&", "is_string", "(", "$", "s", ")", ")", "{", "$", "this", "->", "resetFilters", "(", ")", ";", "$", "this", "->", "options", "[", "'AmazonOrderId'", "]", "=",...
Sets the order ID filter. (Required*) If this parameter is set, Amazon will only return Financial Events that relate to the given order. This parameter is required if none of the other filter options are set. If this parameter is set, the group ID and time range options will be removed. @param string $s <p>Amazon Order ID in 3-7-7 format</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "order", "ID", "filter", ".", "(", "Required", "*", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L83-L90
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.setGroupFilter
public function setGroupFilter($s){ if ($s && is_string($s)) { $this->resetFilters(); $this->options['FinancialEventGroupId'] = $s; } else { return false; } }
php
public function setGroupFilter($s){ if ($s && is_string($s)) { $this->resetFilters(); $this->options['FinancialEventGroupId'] = $s; } else { return false; } }
[ "public", "function", "setGroupFilter", "(", "$", "s", ")", "{", "if", "(", "$", "s", "&&", "is_string", "(", "$", "s", ")", ")", "{", "$", "this", "->", "resetFilters", "(", ")", ";", "$", "this", "->", "options", "[", "'FinancialEventGroupId'", "]"...
Sets the financial event group ID filter. (Required*) If this parameter is set, Amazon will only return Financial Events that belong to the given financial event group. This parameter is required if none of the other filter options are set. If this parameter is set, the order ID and time range options will be removed. @param string $s <p>Financial Event Group ID</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "financial", "event", "group", "ID", "filter", ".", "(", "Required", "*", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L102-L109
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.prepareToken
protected function prepareToken() { if ($this->tokenFlag && $this->tokenUseFlag) { $this->options['Action'] = 'ListFinancialEventsByNextToken'; unset($this->options['MaxResultsPerPage']); $this->resetFilters(); } else { $this->options['Action'] = 'ListFinancialEvents'; unset($this->options['NextToken']); $this->list = array(); } }
php
protected function prepareToken() { if ($this->tokenFlag && $this->tokenUseFlag) { $this->options['Action'] = 'ListFinancialEventsByNextToken'; unset($this->options['MaxResultsPerPage']); $this->resetFilters(); } else { $this->options['Action'] = 'ListFinancialEvents'; unset($this->options['NextToken']); $this->list = array(); } }
[ "protected", "function", "prepareToken", "(", ")", "{", "if", "(", "$", "this", "->", "tokenFlag", "&&", "$", "this", "->", "tokenUseFlag", ")", "{", "$", "this", "->", "options", "[", "'Action'", "]", "=", "'ListFinancialEventsByNextToken'", ";", "unset", ...
Sets up options for using tokens. This changes key options for switching between simply fetching a list and fetching the rest of a list using a token. Please note: because the operation for using tokens does not use any other parameters, all other parameters will be removed.
[ "Sets", "up", "options", "for", "using", "tokens", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L212-L222
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.parseXml
protected function parseXml($xml) { if (!$xml) { return false; } if (isset($xml->ShipmentEventList)) { foreach($xml->ShipmentEventList->children() as $x) { $this->list['Shipment'][] = $this->parseShipmentEvent($x); } } if (isset($xml->RefundEventList)) { foreach($xml->RefundEventList->children() as $x) { $this->list['Refund'][] = $this->parseShipmentEvent($x); } } if (isset($xml->GuaranteeClaimEventList)) { foreach($xml->GuaranteeClaimEventList->children() as $x) { $this->list['GuaranteeClaim'][] = $this->parseShipmentEvent($x); } } if (isset($xml->ChargebackEventList)) { foreach($xml->ChargebackEventList->children() as $x) { $this->list['Chargeback'][] = $this->parseShipmentEvent($x); } } if (isset($xml->PayWithAmazonEventList)) { foreach($xml->PayWithAmazonEventList->children() as $x) { $temp = array(); $temp['SellerOrderId'] = (string)$x->SellerOrderId; $temp['TransactionPostedDate'] = (string)$x->TransactionPostedDate; $temp['BusinessObjectType'] = (string)$x->BusinessObjectType; $temp['SalesChannel'] = (string)$x->SalesChannel; $temp['Charge'] = $this->parseCharge($x->Charge); if (isset($x->FeeList)) { foreach($x->FeeList->children() as $z) { $temp['FeeList'][] = $this->parseFee($z); } } $temp['PaymentAmountType'] = (string)$x->PaymentAmountType; $temp['AmountDescription'] = (string)$x->AmountDescription; $temp['FulfillmentChannel'] = (string)$x->FulfillmentChannel; $temp['StoreName'] = (string)$x->StoreName; $this->list['PayWithAmazon'][] = $temp; } } if (isset($xml->ServiceProviderCreditEventList)) { foreach($xml->ServiceProviderCreditEventList->children() as $x) { $temp = array(); $temp['ProviderTransactionType'] = (string)$x->ProviderTransactionType; $temp['SellerOrderId'] = (string)$x->SellerOrderId; $temp['MarketplaceId'] = (string)$x->MarketplaceId; $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode; $temp['SellerId'] = (string)$x->SellerId; $temp['SellerStoreName'] = (string)$x->SellerStoreName; $temp['ProviderId'] = (string)$x->ProviderId; $temp['ProviderStoreName'] = (string)$x->ProviderStoreName; $this->list['ServiceProviderCredit'][] = $temp; } } if (isset($xml->RetrochargeEventList)) { foreach($xml->RetrochargeEventList->children() as $x) { $temp = array(); $temp['RetrochargeEventType'] = (string)$x->RetrochargeEventType; $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['PostedDate'] = (string)$x->PostedDate; $temp['BaseTax']['Amount'] = (string)$x->BaseTax->CurrencyAmount; $temp['BaseTax']['CurrencyCode'] = (string)$x->BaseTax->CurrencyCode; $temp['ShippingTax']['Amount'] = (string)$x->ShippingTax->CurrencyAmount; $temp['ShippingTax']['CurrencyCode'] = (string)$x->ShippingTax->CurrencyCode; $temp['MarketplaceName'] = (string)$x->MarketplaceName; $this->list['Retrocharge'][] = $temp; } } if (isset($xml->RentalTransactionEventList)) { foreach($xml->RentalTransactionEventList->children() as $x) { $temp = array(); $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['RentalEventType'] = (string)$x->RentalEventType; $temp['ExtensionLength'] = (string)$x->ExtensionLength; $temp['PostedDate'] = (string)$x->PostedDate; if (isset($x->RentalChargeList)) { foreach($x->RentalChargeList->children() as $z) { $temp['RentalChargeList'][] = $this->parseCharge($z); } } if (isset($x->RentalFeeList)) { foreach($x->RentalFeeList->children() as $z) { $temp['RentalFeeList'][] = $this->parseFee($z); } } $temp['MarketplaceName'] = (string)$x->MarketplaceName; if (isset($x->RentalInitialValue)) { $temp['RentalInitialValue']['Amount'] = (string)$x->RentalInitialValue->CurrencyAmount; $temp['RentalInitialValue']['CurrencyCode'] = (string)$x->RentalInitialValue->CurrencyCode; } if (isset($x->RentalReimbursement)) { $temp['RentalReimbursement']['Amount'] = (string)$x->RentalReimbursement->CurrencyAmount; $temp['RentalReimbursement']['CurrencyCode'] = (string)$x->RentalReimbursement->CurrencyCode; } $this->list['RentalTransaction'][] = $temp; } } if (isset($xml->PerformanceBondRefundEventList)) { foreach($xml->PerformanceBondRefundEventList->children() as $x) { $temp = array(); $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode; $temp['Amount'] = (string)$x->Amount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->Amount->CurrencyCode; if (isset($x->ProductGroupList)) { foreach($x->ProductGroupList->children() as $z) { $temp['ProductGroupList'][] = (string)$z; } } $this->list['PerformanceBondRefund'][] = $temp; } } if (isset($xml->ServiceFeeEventList)) { foreach($xml->ServiceFeeEventList->children() as $x) { $temp = array(); $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['FeeReason'] = (string)$x->FeeReason; if (isset($x->FeeList)) { foreach($x->FeeList->children() as $z) { $temp['FeeList'][] = $this->parseFee($z); } } $temp['SellerSKU'] = (string)$x->SellerSKU; $temp['FnSKU'] = (string)$x->FnSKU; $temp['FeeDescription'] = (string)$x->FeeDescription; $temp['ASIN'] = (string)$x->ASIN; $this->list['ServiceFee'][] = $temp; } } if (isset($xml->DebtRecoveryEventList)) { foreach($xml->DebtRecoveryEventList->children() as $x) { $temp = array(); $temp['DebtRecoveryType'] = (string)$x->DebtRecoveryType; $temp['RecoveryAmount']['Amount'] = (string)$x->RecoveryAmount->CurrencyAmount; $temp['RecoveryAmount']['CurrencyCode'] = (string)$x->RecoveryAmount->CurrencyCode; $temp['OverPaymentCredit']['Amount'] = (string)$x->OverPaymentCredit->CurrencyAmount; $temp['OverPaymentCredit']['CurrencyCode'] = (string)$x->OverPaymentCredit->CurrencyCode; if (isset($x->DebtRecoveryItemList)) { foreach($x->DebtRecoveryItemList->children() as $z) { $ztemp = array(); $ztemp['RecoveryAmount']['Amount'] = (string)$z->RecoveryAmount->CurrencyAmount; $ztemp['RecoveryAmount']['CurrencyCode'] = (string)$z->RecoveryAmount->CurrencyCode; $ztemp['OriginalAmount']['Amount'] = (string)$z->OriginalAmount->CurrencyAmount; $ztemp['OriginalAmount']['CurrencyCode'] = (string)$z->OriginalAmount->CurrencyCode; $ztemp['GroupBeginDate'] = (string)$z->GroupBeginDate; $ztemp['GroupEndDate'] = (string)$z->GroupEndDate; $temp['DebtRecoveryItemList'][] = $ztemp; } } if (isset($x->ChargeInstrumentList)) { foreach($x->ChargeInstrumentList->children() as $z) { $ztemp = array(); $ztemp['Description'] = (string)$z->Description; $ztemp['Tail'] = (string)$z->Tail; $ztemp['Amount'] = (string)$z->Amount->CurrencyAmount; $ztemp['CurrencyCode'] = (string)$z->Amount->CurrencyCode; $temp['ChargeInstrumentList'][] = $ztemp; } } $this->list['DebtRecovery'][] = $temp; } } if (isset($xml->LoanServicingEventList)) { foreach($xml->LoanServicingEventList->children() as $x) { $temp = array(); $temp['Amount'] = (string)$x->LoanAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->LoanAmount->CurrencyCode; $temp['SourceBusinessEventType'] = (string)$x->SourceBusinessEventType; $this->list['LoanServicing'][] = $temp; } } if (isset($xml->AdjustmentEventList)) { foreach($xml->AdjustmentEventList->children() as $x) { $temp = array(); $temp['AdjustmentType'] = (string)$x->AdjustmentType; $temp['Amount'] = (string)$x->AdjustmentAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->AdjustmentAmount->CurrencyCode; if (isset($x->AdjustmentItemList)) { foreach($x->AdjustmentItemList->children() as $z) { $ztemp = array(); $ztemp['Quantity'] = (string)$z->Quantity; $ztemp['PerUnitAmount']['Amount'] = (string)$z->PerUnitAmount->CurrencyAmount; $ztemp['PerUnitAmount']['CurrencyCode'] = (string)$z->PerUnitAmount->CurrencyCode; $ztemp['TotalAmount']['Amount'] = (string)$z->TotalAmount->CurrencyAmount; $ztemp['TotalAmount']['CurrencyCode'] = (string)$z->TotalAmount->CurrencyCode; $ztemp['SellerSKU'] = (string)$z->SellerSKU; $ztemp['FnSKU'] = (string)$z->FnSKU; $ztemp['ProductDescription'] = (string)$z->ProductDescription; $ztemp['ASIN'] = (string)$z->ASIN; $temp['AdjustmentItemList'][] = $ztemp; } } $this->list['Adjustment'][] = $temp; } } if (isset($xml->SAFETReimbursementEventList)) { foreach($xml->SAFETReimbursementEventList->children() as $x) { $temp = array(); $temp['PostedDate'] = (string)$x->PostedDate; $temp['SAFETClaimId'] = (string)$x->SAFETClaimId; $temp['Amount'] = (string)$x->ReimbursedAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->ReimbursedAmount->CurrencyCode; $temp['SAFETReimbursementItemList'] = array(); if (isset($x->SAFETReimbursementItemList)) { foreach($x->SAFETReimbursementItemList->children() as $y) { if (!isset($y->ItemChargeList)) { continue; } $ztemp = array(); foreach($y->ItemChargeList->children() as $z) { $ztemp['ItemChargeList'][] = $this->parseCharge($z); } $temp['SAFETReimbursementItemList'][] = $ztemp; } } $this->list['SAFET'][] = $temp; } } }
php
protected function parseXml($xml) { if (!$xml) { return false; } if (isset($xml->ShipmentEventList)) { foreach($xml->ShipmentEventList->children() as $x) { $this->list['Shipment'][] = $this->parseShipmentEvent($x); } } if (isset($xml->RefundEventList)) { foreach($xml->RefundEventList->children() as $x) { $this->list['Refund'][] = $this->parseShipmentEvent($x); } } if (isset($xml->GuaranteeClaimEventList)) { foreach($xml->GuaranteeClaimEventList->children() as $x) { $this->list['GuaranteeClaim'][] = $this->parseShipmentEvent($x); } } if (isset($xml->ChargebackEventList)) { foreach($xml->ChargebackEventList->children() as $x) { $this->list['Chargeback'][] = $this->parseShipmentEvent($x); } } if (isset($xml->PayWithAmazonEventList)) { foreach($xml->PayWithAmazonEventList->children() as $x) { $temp = array(); $temp['SellerOrderId'] = (string)$x->SellerOrderId; $temp['TransactionPostedDate'] = (string)$x->TransactionPostedDate; $temp['BusinessObjectType'] = (string)$x->BusinessObjectType; $temp['SalesChannel'] = (string)$x->SalesChannel; $temp['Charge'] = $this->parseCharge($x->Charge); if (isset($x->FeeList)) { foreach($x->FeeList->children() as $z) { $temp['FeeList'][] = $this->parseFee($z); } } $temp['PaymentAmountType'] = (string)$x->PaymentAmountType; $temp['AmountDescription'] = (string)$x->AmountDescription; $temp['FulfillmentChannel'] = (string)$x->FulfillmentChannel; $temp['StoreName'] = (string)$x->StoreName; $this->list['PayWithAmazon'][] = $temp; } } if (isset($xml->ServiceProviderCreditEventList)) { foreach($xml->ServiceProviderCreditEventList->children() as $x) { $temp = array(); $temp['ProviderTransactionType'] = (string)$x->ProviderTransactionType; $temp['SellerOrderId'] = (string)$x->SellerOrderId; $temp['MarketplaceId'] = (string)$x->MarketplaceId; $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode; $temp['SellerId'] = (string)$x->SellerId; $temp['SellerStoreName'] = (string)$x->SellerStoreName; $temp['ProviderId'] = (string)$x->ProviderId; $temp['ProviderStoreName'] = (string)$x->ProviderStoreName; $this->list['ServiceProviderCredit'][] = $temp; } } if (isset($xml->RetrochargeEventList)) { foreach($xml->RetrochargeEventList->children() as $x) { $temp = array(); $temp['RetrochargeEventType'] = (string)$x->RetrochargeEventType; $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['PostedDate'] = (string)$x->PostedDate; $temp['BaseTax']['Amount'] = (string)$x->BaseTax->CurrencyAmount; $temp['BaseTax']['CurrencyCode'] = (string)$x->BaseTax->CurrencyCode; $temp['ShippingTax']['Amount'] = (string)$x->ShippingTax->CurrencyAmount; $temp['ShippingTax']['CurrencyCode'] = (string)$x->ShippingTax->CurrencyCode; $temp['MarketplaceName'] = (string)$x->MarketplaceName; $this->list['Retrocharge'][] = $temp; } } if (isset($xml->RentalTransactionEventList)) { foreach($xml->RentalTransactionEventList->children() as $x) { $temp = array(); $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['RentalEventType'] = (string)$x->RentalEventType; $temp['ExtensionLength'] = (string)$x->ExtensionLength; $temp['PostedDate'] = (string)$x->PostedDate; if (isset($x->RentalChargeList)) { foreach($x->RentalChargeList->children() as $z) { $temp['RentalChargeList'][] = $this->parseCharge($z); } } if (isset($x->RentalFeeList)) { foreach($x->RentalFeeList->children() as $z) { $temp['RentalFeeList'][] = $this->parseFee($z); } } $temp['MarketplaceName'] = (string)$x->MarketplaceName; if (isset($x->RentalInitialValue)) { $temp['RentalInitialValue']['Amount'] = (string)$x->RentalInitialValue->CurrencyAmount; $temp['RentalInitialValue']['CurrencyCode'] = (string)$x->RentalInitialValue->CurrencyCode; } if (isset($x->RentalReimbursement)) { $temp['RentalReimbursement']['Amount'] = (string)$x->RentalReimbursement->CurrencyAmount; $temp['RentalReimbursement']['CurrencyCode'] = (string)$x->RentalReimbursement->CurrencyCode; } $this->list['RentalTransaction'][] = $temp; } } if (isset($xml->PerformanceBondRefundEventList)) { foreach($xml->PerformanceBondRefundEventList->children() as $x) { $temp = array(); $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode; $temp['Amount'] = (string)$x->Amount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->Amount->CurrencyCode; if (isset($x->ProductGroupList)) { foreach($x->ProductGroupList->children() as $z) { $temp['ProductGroupList'][] = (string)$z; } } $this->list['PerformanceBondRefund'][] = $temp; } } if (isset($xml->ServiceFeeEventList)) { foreach($xml->ServiceFeeEventList->children() as $x) { $temp = array(); $temp['AmazonOrderId'] = (string)$x->AmazonOrderId; $temp['FeeReason'] = (string)$x->FeeReason; if (isset($x->FeeList)) { foreach($x->FeeList->children() as $z) { $temp['FeeList'][] = $this->parseFee($z); } } $temp['SellerSKU'] = (string)$x->SellerSKU; $temp['FnSKU'] = (string)$x->FnSKU; $temp['FeeDescription'] = (string)$x->FeeDescription; $temp['ASIN'] = (string)$x->ASIN; $this->list['ServiceFee'][] = $temp; } } if (isset($xml->DebtRecoveryEventList)) { foreach($xml->DebtRecoveryEventList->children() as $x) { $temp = array(); $temp['DebtRecoveryType'] = (string)$x->DebtRecoveryType; $temp['RecoveryAmount']['Amount'] = (string)$x->RecoveryAmount->CurrencyAmount; $temp['RecoveryAmount']['CurrencyCode'] = (string)$x->RecoveryAmount->CurrencyCode; $temp['OverPaymentCredit']['Amount'] = (string)$x->OverPaymentCredit->CurrencyAmount; $temp['OverPaymentCredit']['CurrencyCode'] = (string)$x->OverPaymentCredit->CurrencyCode; if (isset($x->DebtRecoveryItemList)) { foreach($x->DebtRecoveryItemList->children() as $z) { $ztemp = array(); $ztemp['RecoveryAmount']['Amount'] = (string)$z->RecoveryAmount->CurrencyAmount; $ztemp['RecoveryAmount']['CurrencyCode'] = (string)$z->RecoveryAmount->CurrencyCode; $ztemp['OriginalAmount']['Amount'] = (string)$z->OriginalAmount->CurrencyAmount; $ztemp['OriginalAmount']['CurrencyCode'] = (string)$z->OriginalAmount->CurrencyCode; $ztemp['GroupBeginDate'] = (string)$z->GroupBeginDate; $ztemp['GroupEndDate'] = (string)$z->GroupEndDate; $temp['DebtRecoveryItemList'][] = $ztemp; } } if (isset($x->ChargeInstrumentList)) { foreach($x->ChargeInstrumentList->children() as $z) { $ztemp = array(); $ztemp['Description'] = (string)$z->Description; $ztemp['Tail'] = (string)$z->Tail; $ztemp['Amount'] = (string)$z->Amount->CurrencyAmount; $ztemp['CurrencyCode'] = (string)$z->Amount->CurrencyCode; $temp['ChargeInstrumentList'][] = $ztemp; } } $this->list['DebtRecovery'][] = $temp; } } if (isset($xml->LoanServicingEventList)) { foreach($xml->LoanServicingEventList->children() as $x) { $temp = array(); $temp['Amount'] = (string)$x->LoanAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->LoanAmount->CurrencyCode; $temp['SourceBusinessEventType'] = (string)$x->SourceBusinessEventType; $this->list['LoanServicing'][] = $temp; } } if (isset($xml->AdjustmentEventList)) { foreach($xml->AdjustmentEventList->children() as $x) { $temp = array(); $temp['AdjustmentType'] = (string)$x->AdjustmentType; $temp['Amount'] = (string)$x->AdjustmentAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->AdjustmentAmount->CurrencyCode; if (isset($x->AdjustmentItemList)) { foreach($x->AdjustmentItemList->children() as $z) { $ztemp = array(); $ztemp['Quantity'] = (string)$z->Quantity; $ztemp['PerUnitAmount']['Amount'] = (string)$z->PerUnitAmount->CurrencyAmount; $ztemp['PerUnitAmount']['CurrencyCode'] = (string)$z->PerUnitAmount->CurrencyCode; $ztemp['TotalAmount']['Amount'] = (string)$z->TotalAmount->CurrencyAmount; $ztemp['TotalAmount']['CurrencyCode'] = (string)$z->TotalAmount->CurrencyCode; $ztemp['SellerSKU'] = (string)$z->SellerSKU; $ztemp['FnSKU'] = (string)$z->FnSKU; $ztemp['ProductDescription'] = (string)$z->ProductDescription; $ztemp['ASIN'] = (string)$z->ASIN; $temp['AdjustmentItemList'][] = $ztemp; } } $this->list['Adjustment'][] = $temp; } } if (isset($xml->SAFETReimbursementEventList)) { foreach($xml->SAFETReimbursementEventList->children() as $x) { $temp = array(); $temp['PostedDate'] = (string)$x->PostedDate; $temp['SAFETClaimId'] = (string)$x->SAFETClaimId; $temp['Amount'] = (string)$x->ReimbursedAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->ReimbursedAmount->CurrencyCode; $temp['SAFETReimbursementItemList'] = array(); if (isset($x->SAFETReimbursementItemList)) { foreach($x->SAFETReimbursementItemList->children() as $y) { if (!isset($y->ItemChargeList)) { continue; } $ztemp = array(); foreach($y->ItemChargeList->children() as $z) { $ztemp['ItemChargeList'][] = $this->parseCharge($z); } $temp['SAFETReimbursementItemList'][] = $ztemp; } } $this->list['SAFET'][] = $temp; } } }
[ "protected", "function", "parseXml", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "if", "(", "isset", "(", "$", "xml", "->", "ShipmentEventList", ")", ")", "{", "foreach", "(", "$", "xml", "->", "S...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L231-L452
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.parseShipmentEvent
protected function parseShipmentEvent($xml) { $r = array(); $r['AmazonOrderId'] = (string)$xml->AmazonOrderId; $r['SellerOrderId'] = (string)$xml->SellerOrderId; $r['MarketplaceName'] = (string)$xml->MarketplaceName; $chargeLists = array( 'OrderChargeList', 'OrderChargeAdjustmentList', ); foreach ($chargeLists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $r[$key][] = $this->parseCharge($x); } } } $feelists = array( 'ShipmentFeeList', 'ShipmentFeeAdjustmentList', 'OrderFeeList', 'OrderFeeAdjustmentList', ); foreach ($feelists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $r[$key][] = $this->parseFee($x); } } } if (isset($xml->DirectPaymentList)) { foreach($xml->DirectPaymentList->children() as $x){ $temp = array(); $temp['DirectPaymentType'] = (string)$x->DirectPaymentType; $temp['Amount'] = (string)$x->DirectPaymentAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->DirectPaymentAmount->CurrencyCode; $r['DirectPaymentList'][] = $temp; } } $r['PostedDate'] = (string)$xml->PostedDate; $itemLists = array( 'ShipmentItemList', 'ShipmentItemAdjustmentList', ); $itemChargeLists = array( 'ItemChargeList', 'ItemChargeAdjustmentList', ); $itemFeeLists = array( 'ItemFeeList', 'ItemFeeAdjustmentList', ); $itemPromoLists = array( 'PromotionList', 'PromotionAdjustmentList', ); foreach ($itemLists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $temp = array(); $temp['SellerSKU'] = (string)$x->SellerSKU; $temp['OrderItemId'] = (string)$x->OrderItemId; if (isset($x->OrderAdjustmentItemId)) { $temp['OrderAdjustmentItemId'] = (string)$x->OrderAdjustmentItemId; } $temp['QuantityShipped'] = (string)$x->QuantityShipped; foreach ($itemChargeLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $temp[$zkey][] = $this->parseCharge($z); } } } foreach ($itemFeeLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $temp[$zkey][] = $this->parseFee($z); } } } foreach ($itemPromoLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $ztemp = array(); $ztemp['PromotionType'] = (string)$z->PromotionType; $ztemp['PromotionId'] = (string)$z->PromotionId; $ztemp['Amount'] = (string)$z->PromotionAmount->CurrencyAmount; $ztemp['CurrencyCode'] = (string)$z->PromotionAmount->CurrencyCode; $temp[$zkey][] = $ztemp; } } } if (isset($x->CostOfPointsGranted)) { $temp['CostOfPointsGranted']['Amount'] = (string)$x->CostOfPointsGranted->CurrencyAmount; $temp['CostOfPointsGranted']['CurrencyCode'] = (string)$x->CostOfPointsGranted->CurrencyCode; } if (isset($x->CostOfPointsReturned)) { $temp['CostOfPointsReturned']['Amount'] = (string)$x->CostOfPointsReturned->CurrencyAmount; $temp['CostOfPointsReturned']['CurrencyCode'] = (string)$x->CostOfPointsReturned->CurrencyCode; } $r[$key][] = $temp; } } } return $r; }
php
protected function parseShipmentEvent($xml) { $r = array(); $r['AmazonOrderId'] = (string)$xml->AmazonOrderId; $r['SellerOrderId'] = (string)$xml->SellerOrderId; $r['MarketplaceName'] = (string)$xml->MarketplaceName; $chargeLists = array( 'OrderChargeList', 'OrderChargeAdjustmentList', ); foreach ($chargeLists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $r[$key][] = $this->parseCharge($x); } } } $feelists = array( 'ShipmentFeeList', 'ShipmentFeeAdjustmentList', 'OrderFeeList', 'OrderFeeAdjustmentList', ); foreach ($feelists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $r[$key][] = $this->parseFee($x); } } } if (isset($xml->DirectPaymentList)) { foreach($xml->DirectPaymentList->children() as $x){ $temp = array(); $temp['DirectPaymentType'] = (string)$x->DirectPaymentType; $temp['Amount'] = (string)$x->DirectPaymentAmount->CurrencyAmount; $temp['CurrencyCode'] = (string)$x->DirectPaymentAmount->CurrencyCode; $r['DirectPaymentList'][] = $temp; } } $r['PostedDate'] = (string)$xml->PostedDate; $itemLists = array( 'ShipmentItemList', 'ShipmentItemAdjustmentList', ); $itemChargeLists = array( 'ItemChargeList', 'ItemChargeAdjustmentList', ); $itemFeeLists = array( 'ItemFeeList', 'ItemFeeAdjustmentList', ); $itemPromoLists = array( 'PromotionList', 'PromotionAdjustmentList', ); foreach ($itemLists as $key) { if (isset($xml->$key)) { foreach($xml->$key->children() as $x) { $temp = array(); $temp['SellerSKU'] = (string)$x->SellerSKU; $temp['OrderItemId'] = (string)$x->OrderItemId; if (isset($x->OrderAdjustmentItemId)) { $temp['OrderAdjustmentItemId'] = (string)$x->OrderAdjustmentItemId; } $temp['QuantityShipped'] = (string)$x->QuantityShipped; foreach ($itemChargeLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $temp[$zkey][] = $this->parseCharge($z); } } } foreach ($itemFeeLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $temp[$zkey][] = $this->parseFee($z); } } } foreach ($itemPromoLists as $zkey) { if (isset($x->$zkey)) { foreach($x->$zkey->children() as $z) { $ztemp = array(); $ztemp['PromotionType'] = (string)$z->PromotionType; $ztemp['PromotionId'] = (string)$z->PromotionId; $ztemp['Amount'] = (string)$z->PromotionAmount->CurrencyAmount; $ztemp['CurrencyCode'] = (string)$z->PromotionAmount->CurrencyCode; $temp[$zkey][] = $ztemp; } } } if (isset($x->CostOfPointsGranted)) { $temp['CostOfPointsGranted']['Amount'] = (string)$x->CostOfPointsGranted->CurrencyAmount; $temp['CostOfPointsGranted']['CurrencyCode'] = (string)$x->CostOfPointsGranted->CurrencyCode; } if (isset($x->CostOfPointsReturned)) { $temp['CostOfPointsReturned']['Amount'] = (string)$x->CostOfPointsReturned->CurrencyAmount; $temp['CostOfPointsReturned']['CurrencyCode'] = (string)$x->CostOfPointsReturned->CurrencyCode; } $r[$key][] = $temp; } } } return $r; }
[ "protected", "function", "parseShipmentEvent", "(", "$", "xml", ")", "{", "$", "r", "=", "array", "(", ")", ";", "$", "r", "[", "'AmazonOrderId'", "]", "=", "(", "string", ")", "$", "xml", "->", "AmazonOrderId", ";", "$", "r", "[", "'SellerOrderId'", ...
Parses XML for a single shipment event into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return array parsed structure from XML
[ "Parses", "XML", "for", "a", "single", "shipment", "event", "into", "an", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L459-L563
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.parseCharge
protected function parseCharge($xml) { $r = array(); $r['ChargeType'] = (string)$xml->ChargeType; $r['Amount'] = (string)$xml->ChargeAmount->CurrencyAmount; $r['CurrencyCode'] = (string)$xml->ChargeAmount->CurrencyCode; return $r; }
php
protected function parseCharge($xml) { $r = array(); $r['ChargeType'] = (string)$xml->ChargeType; $r['Amount'] = (string)$xml->ChargeAmount->CurrencyAmount; $r['CurrencyCode'] = (string)$xml->ChargeAmount->CurrencyCode; return $r; }
[ "protected", "function", "parseCharge", "(", "$", "xml", ")", "{", "$", "r", "=", "array", "(", ")", ";", "$", "r", "[", "'ChargeType'", "]", "=", "(", "string", ")", "$", "xml", "->", "ChargeType", ";", "$", "r", "[", "'Amount'", "]", "=", "(", ...
Parses XML for a single charge into an array. This structure is used many times throughout shipment events. @param SimpleXMLElement $xml <p>Charge node of the XML response from Amazon.</p> @return array Parsed structure from XML
[ "Parses", "XML", "for", "a", "single", "charge", "into", "an", "array", ".", "This", "structure", "is", "used", "many", "times", "throughout", "shipment", "events", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L571-L577
CPIGroup/phpAmazonMWS
includes/classes/AmazonFinancialEventList.php
AmazonFinancialEventList.parseFee
protected function parseFee($xml) { $r = array(); $r['FeeType'] = (string)$xml->FeeType; $r['Amount'] = (string)$xml->FeeAmount->CurrencyAmount; $r['CurrencyCode'] = (string)$xml->FeeAmount->CurrencyCode; return $r; }
php
protected function parseFee($xml) { $r = array(); $r['FeeType'] = (string)$xml->FeeType; $r['Amount'] = (string)$xml->FeeAmount->CurrencyAmount; $r['CurrencyCode'] = (string)$xml->FeeAmount->CurrencyCode; return $r; }
[ "protected", "function", "parseFee", "(", "$", "xml", ")", "{", "$", "r", "=", "array", "(", ")", ";", "$", "r", "[", "'FeeType'", "]", "=", "(", "string", ")", "$", "xml", "->", "FeeType", ";", "$", "r", "[", "'Amount'", "]", "=", "(", "string...
Parses XML for a single charge into an array. This structure is used many times throughout shipment events. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return array parsed structure from XML
[ "Parses", "XML", "for", "a", "single", "charge", "into", "an", "array", ".", "This", "structure", "is", "used", "many", "times", "throughout", "shipment", "events", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFinancialEventList.php#L585-L591
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.setStartTime
public function setStartTime($t = null){ if (is_string($t) && $t){ $after = $this->genTime($t); } else { $after = $this->genTime('- 2 min'); } $this->options['QueryStartDateTime'] = $after; $this->resetSkus(); }
php
public function setStartTime($t = null){ if (is_string($t) && $t){ $after = $this->genTime($t); } else { $after = $this->genTime('- 2 min'); } $this->options['QueryStartDateTime'] = $after; $this->resetSkus(); }
[ "public", "function", "setStartTime", "(", "$", "t", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "t", ")", "&&", "$", "t", ")", "{", "$", "after", "=", "$", "this", "->", "genTime", "(", "$", "t", ")", ";", "}", "else", "{", "$",...
Sets the start time. (Required*) This method sets the earliest time frame to be sent in the next request. Setting this parameter tells Amazon to only return inventory supplies that were updated after the given time. If this parameters is set, seller SKUs cannot be set. The parameter is passed through <i>strtotime</i>, so values such as "-1 hour" are fine. @param string $t <p>Time string.</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "start", "time", ".", "(", "Required", "*", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L87-L96
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.setSellerSkus
public function setSellerSkus($a){ if (is_string($a)){ $this->resetSkus(); $this->options['SellerSkus.member.1'] = $a; } else if (is_array($a)){ $this->resetSkus(); $i = 1; foreach($a as $x){ $this->options['SellerSkus.member.'.$i] = $x; $i++; } } else { return false; } unset($this->options['QueryStartDateTime']); }
php
public function setSellerSkus($a){ if (is_string($a)){ $this->resetSkus(); $this->options['SellerSkus.member.1'] = $a; } else if (is_array($a)){ $this->resetSkus(); $i = 1; foreach($a as $x){ $this->options['SellerSkus.member.'.$i] = $x; $i++; } } else { return false; } unset($this->options['QueryStartDateTime']); }
[ "public", "function", "setSellerSkus", "(", "$", "a", ")", "{", "if", "(", "is_string", "(", "$", "a", ")", ")", "{", "$", "this", "->", "resetSkus", "(", ")", ";", "$", "this", "->", "options", "[", "'SellerSkus.member.1'", "]", "=", "$", "a", ";"...
Sets the feed seller SKU(s). (Required*) This method sets the list of seller SKUs to be sent in the next request. Setting this parameter tells Amazon to only return inventory supplies that match the IDs in the list. If this parameter is set, Start Time cannot be set. @param array|string $a <p>A list of Seller SKUs, or a single ID string.</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "feed", "seller", "SKU", "(", "s", ")", ".", "(", "Required", "*", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L107-L122
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.resetSkus
protected function resetSkus(){ foreach($this->options as $op=>$junk){ if(preg_match("#SellerSkus.member.#",$op)){ unset($this->options[$op]); } } }
php
protected function resetSkus(){ foreach($this->options as $op=>$junk){ if(preg_match("#SellerSkus.member.#",$op)){ unset($this->options[$op]); } } }
[ "protected", "function", "resetSkus", "(", ")", "{", "foreach", "(", "$", "this", "->", "options", "as", "$", "op", "=>", "$", "junk", ")", "{", "if", "(", "preg_match", "(", "\"#SellerSkus.member.#\"", ",", "$", "op", ")", ")", "{", "unset", "(", "$...
Resets the seller SKU options. Since seller SKU is a required parameter, these options should not be removed without replacing them, so this method is not public.
[ "Resets", "the", "seller", "SKU", "options", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L130-L136
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.prepareToken
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListInventorySupplyByNextToken'; unset($this->options['QueryStartDateTime']); unset($this->options['ResponseGroup']); $this->resetSkus(); } else { $this->options['Action'] = 'ListInventorySupply'; unset($this->options['NextToken']); $this->index = 0; $this->supplyList = array(); } }
php
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListInventorySupplyByNextToken'; unset($this->options['QueryStartDateTime']); unset($this->options['ResponseGroup']); $this->resetSkus(); } else { $this->options['Action'] = 'ListInventorySupply'; unset($this->options['NextToken']); $this->index = 0; $this->supplyList = array(); } }
[ "protected", "function", "prepareToken", "(", ")", "{", "if", "(", "$", "this", "->", "tokenFlag", "&&", "$", "this", "->", "tokenUseFlag", ")", "{", "$", "this", "->", "options", "[", "'Action'", "]", "=", "'ListInventorySupplyByNextToken'", ";", "unset", ...
Sets up options for using tokens. This changes key options for switching between simply fetching a list and fetching the rest of a list using a token. Please note: because the operation for using tokens does not use any other parameters, all other parameters will be removed.
[ "Sets", "up", "options", "for", "using", "tokens", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L211-L223
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $x){ $this->supplyList[$this->index]['SellerSKU'] = (string)$x->SellerSKU; $this->supplyList[$this->index]['ASIN'] = (string)$x->ASIN; $this->supplyList[$this->index]['TotalSupplyQuantity'] = (string)$x->TotalSupplyQuantity; $this->supplyList[$this->index]['FNSKU'] = (string)$x->FNSKU; $this->supplyList[$this->index]['Condition'] = (string)$x->Condition; $this->supplyList[$this->index]['InStockSupplyQuantity'] = (string)$x->InStockSupplyQuantity; if ((int)$x->TotalSupplyQuantity > 0){ if ($x->EarliestAvailability->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['EarliestAvailability'] = (string)$x->EarliestAvailability->DateTime; } else { $this->supplyList[$this->index]['EarliestAvailability'] = (string)$x->EarliestAvailability->TimepointType; } } if (isset($this->options['ResponseGroup']) && $this->options['ResponseGroup'] == 'Detailed' && isset($x->SupplyDetail)){ $j = 0; foreach($x->SupplyDetail->children() as $z){ if ((string)$z->EarliestAvailableToPick->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['SupplyDetail'][$j]['EarliestAvailableToPick'] = (string)$z->EarliestAvailableToPick->DateTime; } else { $this->supplyList[$this->index]['SupplyDetail'][$j]['EarliestAvailableToPick'] = (string)$z->EarliestAvailableToPick->TimepointType; } if ((string)$z->LatestAvailableToPick->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['SupplyDetail'][$j]['LatestAvailableToPick'] = (string)$z->LatestAvailableToPick->DateTime; } else { $this->supplyList[$this->index]['SupplyDetail'][$j]['LatestAvailableToPick'] = (string)$z->LatestAvailableToPick->TimepointType; } $this->supplyList[$this->index]['SupplyDetail'][$j]['Quantity'] = (string)$z->Quantity; $this->supplyList[$this->index]['SupplyDetail'][$j]['SupplyType'] = (string)$z->SupplyType; $j++; } } $this->index++; } }
php
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $x){ $this->supplyList[$this->index]['SellerSKU'] = (string)$x->SellerSKU; $this->supplyList[$this->index]['ASIN'] = (string)$x->ASIN; $this->supplyList[$this->index]['TotalSupplyQuantity'] = (string)$x->TotalSupplyQuantity; $this->supplyList[$this->index]['FNSKU'] = (string)$x->FNSKU; $this->supplyList[$this->index]['Condition'] = (string)$x->Condition; $this->supplyList[$this->index]['InStockSupplyQuantity'] = (string)$x->InStockSupplyQuantity; if ((int)$x->TotalSupplyQuantity > 0){ if ($x->EarliestAvailability->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['EarliestAvailability'] = (string)$x->EarliestAvailability->DateTime; } else { $this->supplyList[$this->index]['EarliestAvailability'] = (string)$x->EarliestAvailability->TimepointType; } } if (isset($this->options['ResponseGroup']) && $this->options['ResponseGroup'] == 'Detailed' && isset($x->SupplyDetail)){ $j = 0; foreach($x->SupplyDetail->children() as $z){ if ((string)$z->EarliestAvailableToPick->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['SupplyDetail'][$j]['EarliestAvailableToPick'] = (string)$z->EarliestAvailableToPick->DateTime; } else { $this->supplyList[$this->index]['SupplyDetail'][$j]['EarliestAvailableToPick'] = (string)$z->EarliestAvailableToPick->TimepointType; } if ((string)$z->LatestAvailableToPick->TimepointType == 'DateTime'){ $this->supplyList[$this->index]['SupplyDetail'][$j]['LatestAvailableToPick'] = (string)$z->LatestAvailableToPick->DateTime; } else { $this->supplyList[$this->index]['SupplyDetail'][$j]['LatestAvailableToPick'] = (string)$z->LatestAvailableToPick->TimepointType; } $this->supplyList[$this->index]['SupplyDetail'][$j]['Quantity'] = (string)$z->Quantity; $this->supplyList[$this->index]['SupplyDetail'][$j]['SupplyType'] = (string)$z->SupplyType; $j++; } } $this->index++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "x", ")", "{", "$", "this", "->", "supplyList", ...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L232-L270
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getSupply
public function getSupply($i = null){ if (!isset($this->supplyList)){ return false; } if (is_numeric($i)){ return $this->supplyList[$i]; } else { return $this->supplyList; } }
php
public function getSupply($i = null){ if (!isset($this->supplyList)){ return false; } if (is_numeric($i)){ return $this->supplyList[$i]; } else { return $this->supplyList; } }
[ "public", "function", "getSupply", "(", "$", "i", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", ")", "{", "return", ...
Returns the specified fulfillment order, or all of them. This method will return <b>FALSE</b> if the list has not yet been filled. The array for a single fulfillment order will have the following fields: <ul> <li><b>SellerSKU</b> - the seller SKU for the item</li> <li><b>ASIN</b> - the ASIN for the item</li> <li><b>TotalSupplyQuantity</b> - total number available, including in transit</li> <li><b>FNSKU</b> - the Fulfillment Network SKU for the item</li> <li><b>Condition</b> - the condition the item</li> <li><b>InStockSupplyQuantity</b> - total number in a fulfillment center, not counting items in transit</li> <li><b>EarliestAvailability</b> (optional) - time when the item is expected to be available if TotalSupplyQuantity is greater than 0</li> <li><b>SupplyDetail</b> (optional) - multi-dimensional array of extra information returned when the Response Group is set to "Detailed"</li> <ul> <li><b>Quantity</b> - quantity fo a specific item</li> <li><b>SupplyType</b> - "InStock", "Inbound", or "Transfer"</li> <li><b>EarliestAvailableToPick</b> - time point, possibly in ISO 8601 date format</li> <li><b>LatestAvailableToPick</b> - time point, possibly in ISO 8601 date format</li> </ul> </ul> @param int $i [optional] <p>List index to retrieve the value from. If none is given, the entire list will be returned. Defaults to NULL.</p> @return array|boolean array, multi-dimensional array, or <b>FALSE</b> if list not filled yet
[ "Returns", "the", "specified", "fulfillment", "order", "or", "all", "of", "them", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L297-L306
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getSellerSku
public function getSellerSku($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['SellerSKU']; } else { return false; } }
php
public function getSellerSku($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['SellerSKU']; } else { return false; } }
[ "public", "function", "getSellerSku", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "return", "$"...
Returns the seller SKU for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "seller", "SKU", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L315-L324
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getASIN
public function getASIN($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['ASIN']; } else { return false; } }
php
public function getASIN($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['ASIN']; } else { return false; } }
[ "public", "function", "getASIN", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "return", "$", "...
Returns the ASIN for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "ASIN", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L333-L342
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getTotalSupplyQuantity
public function getTotalSupplyQuantity($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['TotalSupplyQuantity']; } else { return false; } }
php
public function getTotalSupplyQuantity($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['TotalSupplyQuantity']; } else { return false; } }
[ "public", "function", "getTotalSupplyQuantity", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "retu...
Returns the total supply quantity for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "total", "supply", "quantity", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L351-L360
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getFNSKU
public function getFNSKU($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['FNSKU']; } else { return false; } }
php
public function getFNSKU($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['FNSKU']; } else { return false; } }
[ "public", "function", "getFNSKU", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "return", "$", ...
Returns the fulfillment network SKU for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "fulfillment", "network", "SKU", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L369-L378
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getCondition
public function getCondition($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['Condition']; } else { return false; } }
php
public function getCondition($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['Condition']; } else { return false; } }
[ "public", "function", "getCondition", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "return", "$"...
Returns the item condition for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "item", "condition", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L387-L396
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getInStockSupplyQuantity
public function getInStockSupplyQuantity($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['InStockSupplyQuantity']; } else { return false; } }
php
public function getInStockSupplyQuantity($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i)){ return $this->supplyList[$i]['InStockSupplyQuantity']; } else { return false; } }
[ "public", "function", "getInStockSupplyQuantity", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", ")", "{", "re...
Returns the in-stock supply quantity for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "in", "-", "stock", "supply", "quantity", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L405-L414
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getEarliestAvailability
public function getEarliestAvailability($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && array_key_exists('EarliestAvailability', $this->supplyList[$i])){ return $this->supplyList[$i]['EarliestAvailability']; } else { return false; } }
php
public function getEarliestAvailability($i = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && array_key_exists('EarliestAvailability', $this->supplyList[$i])){ return $this->supplyList[$i]['EarliestAvailability']; } else { return false; } }
[ "public", "function", "getEarliestAvailability", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "i", ")", "&&", "array_key...
Returns the earliest availability for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "earliest", "availability", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L423-L432
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getSupplyDetails
public function getSupplyDetails($i = 0, $j = null){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && array_key_exists('SupplyDetail', $this->supplyList[$i])){ if (is_numeric($j)) { return $this->supplyList[$i]['SupplyDetail'][$j]; } else { return $this->supplyList[$i]['SupplyDetail']; } } else { return false; } }
php
public function getSupplyDetails($i = 0, $j = null){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && array_key_exists('SupplyDetail', $this->supplyList[$i])){ if (is_numeric($j)) { return $this->supplyList[$i]['SupplyDetail'][$j]; } else { return $this->supplyList[$i]['SupplyDetail']; } } else { return false; } }
[ "public", "function", "getSupplyDetails", "(", "$", "i", "=", "0", ",", "$", "j", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "$", "...
Returns the ASIN for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. If <i>$j</i> is specified, it will return a single supply detail. Otherwise it will return a list of all details for a given supply. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param int $j [optional] <p>Detail index to retrieve the value from. Defaults to NULL.</p> @return array|boolean array of arrays, single detail array, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "ASIN", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L444-L457
CPIGroup/phpAmazonMWS
includes/classes/AmazonInventoryList.php
AmazonInventoryList.getEarliestAvailableToPick
public function getEarliestAvailableToPick($i = 0, $j = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && is_numeric($j) && array_key_exists('SupplyDetail', $this->supplyList[$i])){ return $this->supplyList[$i]['SupplyDetail'][$j]['EarliestAvailableToPick']; } else { return false; } }
php
public function getEarliestAvailableToPick($i = 0, $j = 0){ if (!isset($this->supplyList)){ return false; } if (is_int($i) && is_numeric($j) && array_key_exists('SupplyDetail', $this->supplyList[$i])){ return $this->supplyList[$i]['SupplyDetail'][$j]['EarliestAvailableToPick']; } else { return false; } }
[ "public", "function", "getEarliestAvailableToPick", "(", "$", "i", "=", "0", ",", "$", "j", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "supplyList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_int", "(", "...
Returns the earliest pick timeframe for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @param int $j [optional] <p>Detail index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "earliest", "pick", "timeframe", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonInventoryList.php#L467-L476
CPIGroup/phpAmazonMWS
includes/classes/AmazonPackageTracker.php
AmazonPackageTracker.parseXML
protected function parseXML($d) { if (!$d){ return false; } $this->details['PackageNumber'] = (string)$d->PackageNumber; $this->details['TrackingNumber'] = (string)$d->TrackingNumber; $this->details['CarrierCode'] = (string)$d->CarrierCode; $this->details['CarrierPhoneNumber'] = (string)$d->CarrierPhoneNumber; $this->details['CarrierURL'] = (string)$d->CarrierURL; $this->details['ShipDate'] = (string)$d->ShipDate; //Address $this->details['ShipToAddress']['City'] = (string)$d->ShipToAddress->City; $this->details['ShipToAddress']['State'] = (string)$d->ShipToAddress->State; $this->details['ShipToAddress']['Country'] = (string)$d->ShipToAddress->Country; //End of Address $this->details['CurrentStatus'] = (string)$d->CurrentStatus; $this->details['SignedForBy'] = (string)$d->SignedForBy; $this->details['EstimatedArrivalDate'] = (string)$d->EstimatedArrivalDate; $i = 0; foreach($d->TrackingEvents->children() as $y){ $this->details['TrackingEvents'][$i]['EventDate'] = (string)$y->EventDate; //Address $this->details['TrackingEvents'][$i]['EventAddress']['City'] = (string)$y->EventAddress->City; $this->details['TrackingEvents'][$i]['EventAddress']['State'] = (string)$y->EventAddress->State; $this->details['TrackingEvents'][$i]['EventAddress']['Country'] = (string)$y->EventAddress->Country; //End of Address $this->details['TrackingEvents'][$i]['EventCode'] = (string)$y->EventCode; $i++; } $this->details['AdditionalLocationInfo'] = (string)$d->AdditionalLocationInfo; }
php
protected function parseXML($d) { if (!$d){ return false; } $this->details['PackageNumber'] = (string)$d->PackageNumber; $this->details['TrackingNumber'] = (string)$d->TrackingNumber; $this->details['CarrierCode'] = (string)$d->CarrierCode; $this->details['CarrierPhoneNumber'] = (string)$d->CarrierPhoneNumber; $this->details['CarrierURL'] = (string)$d->CarrierURL; $this->details['ShipDate'] = (string)$d->ShipDate; //Address $this->details['ShipToAddress']['City'] = (string)$d->ShipToAddress->City; $this->details['ShipToAddress']['State'] = (string)$d->ShipToAddress->State; $this->details['ShipToAddress']['Country'] = (string)$d->ShipToAddress->Country; //End of Address $this->details['CurrentStatus'] = (string)$d->CurrentStatus; $this->details['SignedForBy'] = (string)$d->SignedForBy; $this->details['EstimatedArrivalDate'] = (string)$d->EstimatedArrivalDate; $i = 0; foreach($d->TrackingEvents->children() as $y){ $this->details['TrackingEvents'][$i]['EventDate'] = (string)$y->EventDate; //Address $this->details['TrackingEvents'][$i]['EventAddress']['City'] = (string)$y->EventAddress->City; $this->details['TrackingEvents'][$i]['EventAddress']['State'] = (string)$y->EventAddress->State; $this->details['TrackingEvents'][$i]['EventAddress']['Country'] = (string)$y->EventAddress->Country; //End of Address $this->details['TrackingEvents'][$i]['EventCode'] = (string)$y->EventCode; $i++; } $this->details['AdditionalLocationInfo'] = (string)$d->AdditionalLocationInfo; }
[ "protected", "function", "parseXML", "(", "$", "d", ")", "{", "if", "(", "!", "$", "d", ")", "{", "return", "false", ";", "}", "$", "this", "->", "details", "[", "'PackageNumber'", "]", "=", "(", "string", ")", "$", "d", "->", "PackageNumber", ";",...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $d <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonPackageTracker.php#L111-L144
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.setRequests
public function setRequests($a){ if (!is_array($a) || !$a){ $this->log('Tried to set Fee Estimate Requests to invalid values','Warning'); return false; } $this->resetRequests(); $i = 1; foreach ($a as $x){ if (is_array($x) && array_key_exists('MarketplaceId', $x) && array_key_exists('IdType', $x) && array_key_exists('IdValue', $x) && array_key_exists('ListingPrice', $x) && array_key_exists('Identifier', $x) && array_key_exists('IsAmazonFulfilled', $x) && is_array($x['ListingPrice']) && array_key_exists('CurrencyCode', $x['ListingPrice']) && array_key_exists('Value', $x['ListingPrice'])){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.MarketplaceId'] = $x['MarketplaceId']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdType'] = $x['IdType']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdValue'] = $x['IdValue']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.Amount'] = $x['ListingPrice']['Value']; if (isset($x['Shipping']) && is_array($x['Shipping'])){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.Amount'] = $x['Shipping']['Value']; } if (array_key_exists('Points', $x)){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Points.PointsNumber'] = $x['Points']; } $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Identifier'] = $x['Identifier']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IsAmazonFulfilled'] = $x['IsAmazonFulfilled']; $i++; } else { $this->resetRequests(); $this->log('Tried to set Fee Estimate Requests with invalid array','Warning'); return false; } } }
php
public function setRequests($a){ if (!is_array($a) || !$a){ $this->log('Tried to set Fee Estimate Requests to invalid values','Warning'); return false; } $this->resetRequests(); $i = 1; foreach ($a as $x){ if (is_array($x) && array_key_exists('MarketplaceId', $x) && array_key_exists('IdType', $x) && array_key_exists('IdValue', $x) && array_key_exists('ListingPrice', $x) && array_key_exists('Identifier', $x) && array_key_exists('IsAmazonFulfilled', $x) && is_array($x['ListingPrice']) && array_key_exists('CurrencyCode', $x['ListingPrice']) && array_key_exists('Value', $x['ListingPrice'])){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.MarketplaceId'] = $x['MarketplaceId']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdType'] = $x['IdType']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IdValue'] = $x['IdValue']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.CurrencyCode'] = $x['ListingPrice']['CurrencyCode']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.ListingPrice.Amount'] = $x['ListingPrice']['Value']; if (isset($x['Shipping']) && is_array($x['Shipping'])){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.CurrencyCode'] = $x['Shipping']['CurrencyCode']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Shipping.Amount'] = $x['Shipping']['Value']; } if (array_key_exists('Points', $x)){ $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.PriceToEstimateFees.Points.PointsNumber'] = $x['Points']; } $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.Identifier'] = $x['Identifier']; $this->options['FeesEstimateRequestList.FeesEstimateRequest.'.$i.'.IsAmazonFulfilled'] = $x['IsAmazonFulfilled']; $i++; } else { $this->resetRequests(); $this->log('Tried to set Fee Estimate Requests with invalid array','Warning'); return false; } } }
[ "public", "function", "setRequests", "(", "$", "a", ")", "{", "if", "(", "!", "is_array", "(", "$", "a", ")", "||", "!", "$", "a", ")", "{", "$", "this", "->", "log", "(", "'Tried to set Fee Estimate Requests to invalid values'", ",", "'Warning'", ")", "...
Sets the estimate request(s). (Required) This method sets the list of estimate requests to be sent in the next request. This parameter is required for getting fee estimates from Amazon. The array provided should contain a list of arrays, each with the following fields: <ul> <li><b>MarketplaceId</b> - an Amazon marketplace ID</li> <li><b>IdType</b> - "ASIN" or "SellerSKU"</li> <li><b>IdValue</b> - product identifier</li> <li><b>ListingPrice</b> - array</li> <ul> <li><b>CurrencyCode</b> - ISO 4217 currency code</li> <li><b>Value</b> - number</li> </ul> <li><b>Shipping</b> (optional) - array</li> <ul> <li><b>CurrencyCode</b> - ISO 4217 currency code</li> <li><b>Value</b> - number</li> </ul> <li><b>Points</b> (optional) - number</li> <li><b>Identifier</b> - unique value that will identify this request</li> <li><b>IsAmazonFulfilled</b> - if offer is fulfilled by Amazon, boolean</li> </ul> @param array $a <p>See above.</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "estimate", "request", "(", "s", ")", ".", "(", "Required", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L81-L117
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.resetRequests
protected function resetRequests() { foreach($this->options as $op=>$junk){ if(preg_match("#FeesEstimateRequestList#",$op)){ unset($this->options[$op]); } } }
php
protected function resetRequests() { foreach($this->options as $op=>$junk){ if(preg_match("#FeesEstimateRequestList#",$op)){ unset($this->options[$op]); } } }
[ "protected", "function", "resetRequests", "(", ")", "{", "foreach", "(", "$", "this", "->", "options", "as", "$", "op", "=>", "$", "junk", ")", "{", "if", "(", "preg_match", "(", "\"#FeesEstimateRequestList#\"", ",", "$", "op", ")", ")", "{", "unset", ...
Removes request options. Since the list of requests is a required parameter, these options should not be removed without replacing them, so this method is not public.
[ "Removes", "request", "options", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L125-L131
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.parseXml
protected function parseXml($xml){ if (!$xml){ return false; } $this->productList = array(); if (!isset($xml->FeesEstimateResultList)){ return; } foreach($xml->FeesEstimateResultList->children() as $x){ $temp = array(); $temp['MarketplaceId'] = (string)$x->FeesEstimateIdentifier->MarketplaceId; $temp['IdType'] = (string)$x->FeesEstimateIdentifier->IdType; $temp['IdValue'] = (string)$x->FeesEstimateIdentifier->IdValue; $temp['ListingPrice'] = $this->parseMoney($x->FeesEstimateIdentifier->PriceToEstimateFees->ListingPrice); if (isset($x->FeesEstimateIdentifier->PriceToEstimateFees->Shipping)){ $temp['Shipping'] = $this->parseMoney($x->FeesEstimateIdentifier->PriceToEstimateFees->Shipping); } if (isset($x->FeesEstimateIdentifier->PriceToEstimateFees->Points->PointsNumber)){ $temp['Points'] = (string)$x->FeesEstimateIdentifier->PriceToEstimateFees->Points->PointsNumber; } $temp['IsAmazonFulfilled'] = (string)$x->FeesEstimateIdentifier->IsAmazonFulfilled; $temp['SellerInputIdentifier'] = (string)$x->FeesEstimateIdentifier->SellerInputIdentifier; $temp['TimeOfFeesEstimation'] = (string)$x->FeesEstimateIdentifier->TimeOfFeesEstimation; $temp['Status'] = (string)$x->Status; if (isset($x->FeesEstimate)){ $temp['TotalFeesEstimate'] = $this->parseMoney($x->FeesEstimate->TotalFeesEstimate); $temp['FeeDetailList'] = array(); if (isset($x->FeesEstimate->FeeDetailList)){ foreach($x->FeesEstimate->FeeDetailList->children() as $z){ $temp['FeeDetailList'][] = $this->parseFeeDetail($z); } } } if (isset($x->Error)){ $temp['Error']['Type'] = (string)$x->Error->Type; $temp['Error']['Code'] = (string)$x->Error->Code; $temp['Error']['Message'] = (string)$x->Error->Message; } $this->productList[] = $temp; } }
php
protected function parseXml($xml){ if (!$xml){ return false; } $this->productList = array(); if (!isset($xml->FeesEstimateResultList)){ return; } foreach($xml->FeesEstimateResultList->children() as $x){ $temp = array(); $temp['MarketplaceId'] = (string)$x->FeesEstimateIdentifier->MarketplaceId; $temp['IdType'] = (string)$x->FeesEstimateIdentifier->IdType; $temp['IdValue'] = (string)$x->FeesEstimateIdentifier->IdValue; $temp['ListingPrice'] = $this->parseMoney($x->FeesEstimateIdentifier->PriceToEstimateFees->ListingPrice); if (isset($x->FeesEstimateIdentifier->PriceToEstimateFees->Shipping)){ $temp['Shipping'] = $this->parseMoney($x->FeesEstimateIdentifier->PriceToEstimateFees->Shipping); } if (isset($x->FeesEstimateIdentifier->PriceToEstimateFees->Points->PointsNumber)){ $temp['Points'] = (string)$x->FeesEstimateIdentifier->PriceToEstimateFees->Points->PointsNumber; } $temp['IsAmazonFulfilled'] = (string)$x->FeesEstimateIdentifier->IsAmazonFulfilled; $temp['SellerInputIdentifier'] = (string)$x->FeesEstimateIdentifier->SellerInputIdentifier; $temp['TimeOfFeesEstimation'] = (string)$x->FeesEstimateIdentifier->TimeOfFeesEstimation; $temp['Status'] = (string)$x->Status; if (isset($x->FeesEstimate)){ $temp['TotalFeesEstimate'] = $this->parseMoney($x->FeesEstimate->TotalFeesEstimate); $temp['FeeDetailList'] = array(); if (isset($x->FeesEstimate->FeeDetailList)){ foreach($x->FeesEstimate->FeeDetailList->children() as $z){ $temp['FeeDetailList'][] = $this->parseFeeDetail($z); } } } if (isset($x->Error)){ $temp['Error']['Type'] = (string)$x->Error->Type; $temp['Error']['Code'] = (string)$x->Error->Code; $temp['Error']['Message'] = (string)$x->Error->Message; } $this->productList[] = $temp; } }
[ "protected", "function", "parseXml", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "this", "->", "productList", "=", "array", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "xml", "->", "F...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L174-L215
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.parseMoney
protected function parseMoney($xml){ $r = array(); $r['Amount'] = (string)$xml->Amount; $r['CurrencyCode'] = (string)$xml->CurrencyCode; return $r; }
php
protected function parseMoney($xml){ $r = array(); $r['Amount'] = (string)$xml->Amount; $r['CurrencyCode'] = (string)$xml->CurrencyCode; return $r; }
[ "protected", "function", "parseMoney", "(", "$", "xml", ")", "{", "$", "r", "=", "array", "(", ")", ";", "$", "r", "[", "'Amount'", "]", "=", "(", "string", ")", "$", "xml", "->", "Amount", ";", "$", "r", "[", "'CurrencyCode'", "]", "=", "(", "...
Parses XML for a single money element into an array. This structure is used many times throughout fee estimates. @param SimpleXMLElement $xml <p>Money node of the XML response from Amazon.</p> @return array Parsed structure from XML
[ "Parses", "XML", "for", "a", "single", "money", "element", "into", "an", "array", ".", "This", "structure", "is", "used", "many", "times", "throughout", "fee", "estimates", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L223-L228
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.parseFeeDetail
protected function parseFeeDetail($xml){ $r = array(); $r['FeeType'] = (string)$xml->FeeType; $r['FeeAmount'] = $this->parseMoney($xml->FeeAmount); if (isset($xml->FeePromotion)){ $r['FeePromotion'] = $this->parseMoney($xml->FeePromotion); } if (isset($xml->TaxAmount)){ $r['TaxAmount'] = $this->parseMoney($xml->TaxAmount); } $r['FinalFee'] = $this->parseMoney($xml->FinalFee); if (isset($xml->IncludedFeeDetailList)){ $r['IncludedFeeDetailList'] = array(); foreach($xml->IncludedFeeDetailList->children() as $x){ $r['IncludedFeeDetailList'][] = $this->parseFeeDetail($x); } } return $r; }
php
protected function parseFeeDetail($xml){ $r = array(); $r['FeeType'] = (string)$xml->FeeType; $r['FeeAmount'] = $this->parseMoney($xml->FeeAmount); if (isset($xml->FeePromotion)){ $r['FeePromotion'] = $this->parseMoney($xml->FeePromotion); } if (isset($xml->TaxAmount)){ $r['TaxAmount'] = $this->parseMoney($xml->TaxAmount); } $r['FinalFee'] = $this->parseMoney($xml->FinalFee); if (isset($xml->IncludedFeeDetailList)){ $r['IncludedFeeDetailList'] = array(); foreach($xml->IncludedFeeDetailList->children() as $x){ $r['IncludedFeeDetailList'][] = $this->parseFeeDetail($x); } } return $r; }
[ "protected", "function", "parseFeeDetail", "(", "$", "xml", ")", "{", "$", "r", "=", "array", "(", ")", ";", "$", "r", "[", "'FeeType'", "]", "=", "(", "string", ")", "$", "xml", "->", "FeeType", ";", "$", "r", "[", "'FeeAmount'", "]", "=", "$", ...
Parses XML for a single fee detail into an array. This structure is used recursively in fee estimates. @param SimpleXMLElement $xml <p>Fee Detail node of the XML response from Amazon.</p> @return array Parsed structure from XML
[ "Parses", "XML", "for", "a", "single", "fee", "detail", "into", "an", "array", ".", "This", "structure", "is", "used", "recursively", "in", "fee", "estimates", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L236-L254
CPIGroup/phpAmazonMWS
includes/classes/AmazonProductFeeEstimate.php
AmazonProductFeeEstimate.getEstimates
public function getEstimates($num = null){ if (!isset($this->productList)){ return false; } if (is_numeric($num)){ return $this->productList[$num]; } else { return $this->productList; } }
php
public function getEstimates($num = null){ if (!isset($this->productList)){ return false; } if (is_numeric($num)){ return $this->productList[$num]; } else { return $this->productList; } }
[ "public", "function", "getEstimates", "(", "$", "num", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "productList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "num", ")", ")", "{", "re...
Returns fee estimate specified or array of fee estimates. Each estimate array will have the following keys: <ul> <li><b>MarketplaceId</b></li> <li><b>IdType</b> - "ASIN" or "SellerSKU"</li> <li><b>IdValue</b></li> <li><b>ListingPrice</b> - money array</li> <li><b>Shipping</b> (optional) - money array</li> <li><b>Points</b> (optional)</li> <li><b>IsAmazonFulfilled</b> - "true" or "false"</li> <li><b>SellerInputIdentifier</b></li> <li><b>TimeOfFeesEstimation</b> - ISO 8601 date format</li> <li><b>Status</b></li> <li><b>TotalFeesEstimate</b> (optional) - money array</li> <li><b>FeeDetailList</b> (optional) - array of fee detail arrays</li> <li><b>Error</b> (optional) - array</li> <ul> <li><b>Type</b></li> <li><b>Code</b></li> <li><b>Message</b></li> </ul> </ul> Each "money" array has the following keys: <ul> <li><b>Amount</b> - number</li> <li><b>CurrencyCode</b> - ISO 4217 currency code</li> </ul> Each "fee detail" array has the following keys: <ul> <li><b>FeeType</b> - "ReferralFee", "VariableClosingFee", "PerItemFee", "FBAFees", "FBAPickAndPack", "FBAWeightHandling", "FBAOrderHandling", or "FBADeliveryServicesFee"</li> <li><b>FeeAmount</b> - money array</li> <li><b>FeePromotion</b> (optional) - money array</li> <li><b>TaxAmount</b> (optional) - money array</li> <li><b>FinalFee</b> - money array</li> <li><b>IncludedFeeDetailList</b> (optional) - array of fee detail arrays</li> </ul> @param int $num [optional] <p>List index to retrieve the value from.</p> @return array|boolean multi-dimensional array, or <b>FALSE</b> if list not filled yet
[ "Returns", "fee", "estimate", "specified", "or", "array", "of", "fee", "estimates", ".", "Each", "estimate", "array", "will", "have", "the", "following", "keys", ":", "<ul", ">", "<li", ">", "<b", ">", "MarketplaceId<", "/", "b", ">", "<", "/", "li", "...
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProductFeeEstimate.php#L299-L308
CPIGroup/phpAmazonMWS
includes/classes/AmazonPreorder.php
AmazonPreorder.setNeedByDate
public function setNeedByDate($d) { try{ $this->options['NeedByDate'] = strstr($this->genTime($d), 'T', true); } catch (Exception $e){ unset($this->options['NeedByDate']); $this->log('Error: '.$e->getMessage(), 'Warning'); return false; } }
php
public function setNeedByDate($d) { try{ $this->options['NeedByDate'] = strstr($this->genTime($d), 'T', true); } catch (Exception $e){ unset($this->options['NeedByDate']); $this->log('Error: '.$e->getMessage(), 'Warning'); return false; } }
[ "public", "function", "setNeedByDate", "(", "$", "d", ")", "{", "try", "{", "$", "this", "->", "options", "[", "'NeedByDate'", "]", "=", "strstr", "(", "$", "this", "->", "genTime", "(", "$", "d", ")", ",", "'T'", ",", "true", ")", ";", "}", "cat...
Sets the maximum arrival date for the shipment. (Required to confirm) This method sets the max arrival date to be sent in the next request. This parameter is required to use <i>confirmPreorder</i> and is removed by <i>fetchPreorderInfo</i>. @param string $d <p>A time string</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "maximum", "arrival", "date", "for", "the", "shipment", ".", "(", "Required", "to", "confirm", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonPreorder.php#L82-L90
CPIGroup/phpAmazonMWS
includes/classes/AmazonPreorder.php
AmazonPreorder.parseXml
protected function parseXml($xml) { if (!$xml){ return false; } $this->needByDate = null; if (isset($xml->NeedByDate)) { $this->needByDate = (string)$xml->NeedByDate; } if (isset($xml->ConfirmedNeedByDate)) { $this->needByDate = (string)$xml->ConfirmedNeedByDate; } $this->fulfillableDate = (string)$xml->ConfirmedFulfillableDate; if (isset($xml->ShipmentContainsPreorderableItems)) { $this->hasPreorderItems = (string)$xml->ShipmentContainsPreorderableItems; } if (isset($xml->ShipmentConfirmedForPreorder)) { $this->isConfirmed = (string)$xml->ShipmentConfirmedForPreorder; } }
php
protected function parseXml($xml) { if (!$xml){ return false; } $this->needByDate = null; if (isset($xml->NeedByDate)) { $this->needByDate = (string)$xml->NeedByDate; } if (isset($xml->ConfirmedNeedByDate)) { $this->needByDate = (string)$xml->ConfirmedNeedByDate; } $this->fulfillableDate = (string)$xml->ConfirmedFulfillableDate; if (isset($xml->ShipmentContainsPreorderableItems)) { $this->hasPreorderItems = (string)$xml->ShipmentContainsPreorderableItems; } if (isset($xml->ShipmentConfirmedForPreorder)) { $this->isConfirmed = (string)$xml->ShipmentConfirmedForPreorder; } }
[ "protected", "function", "parseXml", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "this", "->", "needByDate", "=", "null", ";", "if", "(", "isset", "(", "$", "xml", "->", "NeedByDate", ")", ")...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonPreorder.php#L202-L221
CPIGroup/phpAmazonMWS
includes/classes/AmazonReportList.php
AmazonReportList.setAcknowledgedFilter
public function setAcknowledgedFilter($s){ if ($s == 'true' || (is_bool($s) && $s == true)){ $this->options['Acknowledged'] = 'true'; } else if ($s == 'false' || (is_bool($s) && $s == false)){ $this->options['Acknowledged'] = 'false'; } else if ($s == null){ unset($this->options['Acknowledged']); } else { return false; } }
php
public function setAcknowledgedFilter($s){ if ($s == 'true' || (is_bool($s) && $s == true)){ $this->options['Acknowledged'] = 'true'; } else if ($s == 'false' || (is_bool($s) && $s == false)){ $this->options['Acknowledged'] = 'false'; } else if ($s == null){ unset($this->options['Acknowledged']); } else { return false; } }
[ "public", "function", "setAcknowledgedFilter", "(", "$", "s", ")", "{", "if", "(", "$", "s", "==", "'true'", "||", "(", "is_bool", "(", "$", "s", ")", "&&", "$", "s", "==", "true", ")", ")", "{", "$", "this", "->", "options", "[", "'Acknowledged'",...
Sets the report acknowledgement filter. (Optional) Setting this parameter to <b>TRUE</b> lists only reports that have been acknowledged. Setting this parameter to <b>FALSE</b> lists only reports that have not been acknowledged yet. @param string|boolean $s <p>"true" or "false", or boolean</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "report", "acknowledgement", "filter", ".", "(", "Optional", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonReportList.php#L184-L194
CPIGroup/phpAmazonMWS
includes/classes/AmazonReportList.php
AmazonReportList.prepareToken
protected function prepareToken(){ include($this->env); if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'GetReportListByNextToken'; if(isset($THROTTLE_LIMIT_REPORTTOKEN)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTTOKEN; } if(isset($THROTTLE_TIME_REPORTTOKEN)) { $this->throttleTime = $THROTTLE_TIME_REPORTTOKEN; } $this->throttleGroup = 'GetReportListByNextToken'; $this->resetRequestIds(); $this->resetReportTypes(); $this->resetTimeLimits(); unset($this->options['MaxCount']); unset($this->options['Acknowledged']); } else { $this->options['Action'] = 'GetReportList'; if(isset($THROTTLE_LIMIT_REPORTLIST)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTLIST; } if(isset($THROTTLE_TIME_REPORTLIST)) { $this->throttleTime = $THROTTLE_TIME_REPORTLIST; } $this->throttleGroup = 'GetReportList'; unset($this->options['NextToken']); $this->reportList = array(); $this->index = 0; } }
php
protected function prepareToken(){ include($this->env); if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'GetReportListByNextToken'; if(isset($THROTTLE_LIMIT_REPORTTOKEN)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTTOKEN; } if(isset($THROTTLE_TIME_REPORTTOKEN)) { $this->throttleTime = $THROTTLE_TIME_REPORTTOKEN; } $this->throttleGroup = 'GetReportListByNextToken'; $this->resetRequestIds(); $this->resetReportTypes(); $this->resetTimeLimits(); unset($this->options['MaxCount']); unset($this->options['Acknowledged']); } else { $this->options['Action'] = 'GetReportList'; if(isset($THROTTLE_LIMIT_REPORTLIST)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTLIST; } if(isset($THROTTLE_TIME_REPORTLIST)) { $this->throttleTime = $THROTTLE_TIME_REPORTLIST; } $this->throttleGroup = 'GetReportList'; unset($this->options['NextToken']); $this->reportList = array(); $this->index = 0; } }
[ "protected", "function", "prepareToken", "(", ")", "{", "include", "(", "$", "this", "->", "env", ")", ";", "if", "(", "$", "this", "->", "tokenFlag", "&&", "$", "this", "->", "tokenUseFlag", ")", "{", "$", "this", "->", "options", "[", "'Action'", "...
Sets up options for using tokens. This changes key options for switching between simply fetching a list and fetching the rest of a list using a token. Please note: because the operation for using tokens does not use any other parameters, all other parameters will be removed.
[ "Sets", "up", "options", "for", "using", "tokens", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonReportList.php#L287-L316
CPIGroup/phpAmazonMWS
includes/classes/AmazonReportList.php
AmazonReportList.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $key=>$x){ $i = $this->index; if ($key != 'ReportInfo'){ continue; } $this->reportList[$i]['ReportId'] = (string)$x->ReportId; $this->reportList[$i]['ReportType'] = (string)$x->ReportType; $this->reportList[$i]['ReportRequestId'] = (string)$x->ReportRequestId; $this->reportList[$i]['AvailableDate'] = (string)$x->AvailableDate; $this->reportList[$i]['Acknowledged'] = (string)$x->Acknowledged; if (isset($x->AcknowledgedDate)) { $this->reportList[$i]['AcknowledgedDate'] = (string)$x->AcknowledgedDate; } $this->index++; } }
php
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $key=>$x){ $i = $this->index; if ($key != 'ReportInfo'){ continue; } $this->reportList[$i]['ReportId'] = (string)$x->ReportId; $this->reportList[$i]['ReportType'] = (string)$x->ReportType; $this->reportList[$i]['ReportRequestId'] = (string)$x->ReportRequestId; $this->reportList[$i]['AvailableDate'] = (string)$x->AvailableDate; $this->reportList[$i]['Acknowledged'] = (string)$x->Acknowledged; if (isset($x->AcknowledgedDate)) { $this->reportList[$i]['AcknowledgedDate'] = (string)$x->AcknowledgedDate; } $this->index++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "key", "=>", "$", "x", ")", "{", "$", "i", "...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonReportList.php#L325-L346
CPIGroup/phpAmazonMWS
includes/classes/AmazonReportList.php
AmazonReportList.prepareCount
protected function prepareCount(){ include($this->env); $this->options['Action'] = 'GetReportCount'; if(isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST; } if(isset($THROTTLE_TIME_REPORTREQUESTLIST)) { $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST; } $this->throttleGroup = 'GetReportCount'; unset($this->options['NextToken']); unset($this->options['MaxCount']); $this->resetRequestIds(); }
php
protected function prepareCount(){ include($this->env); $this->options['Action'] = 'GetReportCount'; if(isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) { $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST; } if(isset($THROTTLE_TIME_REPORTREQUESTLIST)) { $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST; } $this->throttleGroup = 'GetReportCount'; unset($this->options['NextToken']); unset($this->options['MaxCount']); $this->resetRequestIds(); }
[ "protected", "function", "prepareCount", "(", ")", "{", "include", "(", "$", "this", "->", "env", ")", ";", "$", "this", "->", "options", "[", "'Action'", "]", "=", "'GetReportCount'", ";", "if", "(", "isset", "(", "$", "THROTTLE_LIMIT_REPORTREQUESTLIST", ...
Sets up options for using <i>fetchCount</i>. This changes key options for using <i>fetchCount</i>. Please note: because the operation for counting reports does not use all of the parameters, some of the parameters will be removed. The following parameters are removed: request IDs, max count, and token.
[ "Sets", "up", "options", "for", "using", "<i", ">", "fetchCount<", "/", "i", ">", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonReportList.php#L387-L400
CPIGroup/phpAmazonMWS
includes/classes/AmazonProduct.php
AmazonProduct.loadXML
public function loadXML($xml){ if (!$xml){ return false; } $this->data = array(); //Categories first if ($xml->getName() == 'GetProductCategoriesForSKUResult' || $xml->getName() == 'GetProductCategoriesForASINResult'){ $this->loadCategories($xml); return; } //Lowest Price uses different format if ($xml->getName() == 'GetLowestPricedOffersForSKUResult' || $xml->getName() == 'GetLowestPricedOffersForASINResult'){ return $this->loadLowestPricedOfferXml($xml); } if ($xml->getName() != 'Product'){ return; } //Identifiers if ($xml->Identifiers){ foreach($xml->Identifiers->children() as $x){ foreach($x->children() as $z){ $this->data['Identifiers'][$x->getName()][$z->getName()] = (string)$z; } } } //AttributeSets if ($xml->AttributeSets){ $anum = 0; foreach($xml->AttributeSets->children('ns2',true) as $aset){ foreach($aset->children('ns2',true) as $x){ if ($x->children('ns2',true)->count() > 0){ //another layer foreach($x->children('ns2',true) as $y){ if ($y->children('ns2',true)->count() > 0){ //we need to go deeper foreach($y->children('ns2',true) as $z){ if ($z->children('ns2',true)->count() > 0){ //we need to go deeper $this->log('Warning! Attribute '.$z->getName().' is too deep for this!', 'Urgent'); } else { $this->data['AttributeSets'][$anum][$x->getName()][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['AttributeSets'][$anum][$x->getName()][$y->getName()] = (string)$y; } } } else { //Check for duplicates if (array_key_exists('AttributeSets', $this->data) && array_key_exists($anum, $this->data['AttributeSets']) && array_key_exists($x->getName(), $this->data['AttributeSets'][$anum])){ //check for previous cases of duplicates if (is_array($this->data['AttributeSets'][$anum][$x->getName()])){ $this->data['AttributeSets'][$anum][$x->getName()][] = (string)$x; } else { //first instance of duplicates, make into array $temp = array($this->data['AttributeSets'][$anum][$x->getName()]); $this->data['AttributeSets'][$anum][$x->getName()] = $temp; $this->data['AttributeSets'][$anum][$x->getName()][] = (string)$x; } } else { //no duplicates $this->data['AttributeSets'][$anum][$x->getName()] = (string)$x; } } } $anum++; } } //Relationships if ($xml->Relationships){ foreach($xml->Relationships->children() as $x){ $temp = array(); foreach($x->children() as $y){ foreach($y->children() as $z){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } } foreach($x->children('ns2',true) as $y){ $temp[$y->getName()] = (string)$y; } $this->data['Relationships'][$x->getName()][] = $temp; } //child relations use namespace but parent does not foreach($xml->Relationships->children('ns2',true) as $x){ $temp = array(); foreach($x->children() as $y){ foreach($y->children() as $z){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } } foreach($x->children('ns2',true) as $y){ $temp[$y->getName()] = (string)$y; } $this->data['Relationships'][$x->getName()][] = $temp; } } //CompetitivePricing if ($xml->CompetitivePricing){ //CompetitivePrices foreach($xml->CompetitivePricing->CompetitivePrices->children() as $pset){ $pnum = (string)$pset->CompetitivePriceId; $temp = (array)$pset->attributes(); $belongs = $temp['@attributes']['belongsToRequester']; $con = $temp['@attributes']['condition']; $sub = $temp['@attributes']['subcondition']; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['belongsToRequester'] = $belongs; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['condition'] = $con; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['subcondition'] = $sub; foreach($pset->Price->children() as $x){ //CompetitivePrice->Price foreach($x->children() as $y){ $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['Price'][$x->getName()][$y->getName()] = (string)$y; } } $pnum++; } //NumberOfOfferListings if ($xml->CompetitivePricing->NumberOfOfferListings){ foreach($xml->CompetitivePricing->NumberOfOfferListings->children() as $x){ $temp = (array)$x->attributes(); $att = $temp['@attributes']['condition']; $this->data['CompetitivePricing']['NumberOfOfferListings'][$x->getName()][$att] = (string)$x; } } //TradeInValue if ($xml->CompetitivePricing->TradeInValue){ foreach($xml->CompetitivePricing->TradeInValue->children() as $x){ $this->data['CompetitivePricing']['TradeInValue'][$x->getName()] = (string)$x; } } } //SalesRankings if ($xml->SalesRankings){ foreach($xml->SalesRankings->children() as $x){ $temp = array(); foreach($x->children() as $y){ $temp[$y->getName()] = (string)$y; } $this->data['SalesRankings'][$x->getName()][] = $temp; } } //LowestOfferListings if ($xml->LowestOfferListings){ $lnum = 0; foreach($xml->LowestOfferListings->children() as $x){ //LowestOfferListing foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $this->data['LowestOfferListings'][$lnum][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $this->data['LowestOfferListings'][$lnum][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['LowestOfferListings'][$lnum][$y->getName()] = (string)$y; } } $lnum++; } } //Offers if ($xml->Offers){ $onum = 0; foreach($xml->Offers->children() as $x){ //Offer foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $this->data['Offers'][$onum][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $this->data['Offers'][$onum][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['Offers'][$onum][$y->getName()] = (string)$y; } } $onum++; } } }
php
public function loadXML($xml){ if (!$xml){ return false; } $this->data = array(); //Categories first if ($xml->getName() == 'GetProductCategoriesForSKUResult' || $xml->getName() == 'GetProductCategoriesForASINResult'){ $this->loadCategories($xml); return; } //Lowest Price uses different format if ($xml->getName() == 'GetLowestPricedOffersForSKUResult' || $xml->getName() == 'GetLowestPricedOffersForASINResult'){ return $this->loadLowestPricedOfferXml($xml); } if ($xml->getName() != 'Product'){ return; } //Identifiers if ($xml->Identifiers){ foreach($xml->Identifiers->children() as $x){ foreach($x->children() as $z){ $this->data['Identifiers'][$x->getName()][$z->getName()] = (string)$z; } } } //AttributeSets if ($xml->AttributeSets){ $anum = 0; foreach($xml->AttributeSets->children('ns2',true) as $aset){ foreach($aset->children('ns2',true) as $x){ if ($x->children('ns2',true)->count() > 0){ //another layer foreach($x->children('ns2',true) as $y){ if ($y->children('ns2',true)->count() > 0){ //we need to go deeper foreach($y->children('ns2',true) as $z){ if ($z->children('ns2',true)->count() > 0){ //we need to go deeper $this->log('Warning! Attribute '.$z->getName().' is too deep for this!', 'Urgent'); } else { $this->data['AttributeSets'][$anum][$x->getName()][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['AttributeSets'][$anum][$x->getName()][$y->getName()] = (string)$y; } } } else { //Check for duplicates if (array_key_exists('AttributeSets', $this->data) && array_key_exists($anum, $this->data['AttributeSets']) && array_key_exists($x->getName(), $this->data['AttributeSets'][$anum])){ //check for previous cases of duplicates if (is_array($this->data['AttributeSets'][$anum][$x->getName()])){ $this->data['AttributeSets'][$anum][$x->getName()][] = (string)$x; } else { //first instance of duplicates, make into array $temp = array($this->data['AttributeSets'][$anum][$x->getName()]); $this->data['AttributeSets'][$anum][$x->getName()] = $temp; $this->data['AttributeSets'][$anum][$x->getName()][] = (string)$x; } } else { //no duplicates $this->data['AttributeSets'][$anum][$x->getName()] = (string)$x; } } } $anum++; } } //Relationships if ($xml->Relationships){ foreach($xml->Relationships->children() as $x){ $temp = array(); foreach($x->children() as $y){ foreach($y->children() as $z){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } } foreach($x->children('ns2',true) as $y){ $temp[$y->getName()] = (string)$y; } $this->data['Relationships'][$x->getName()][] = $temp; } //child relations use namespace but parent does not foreach($xml->Relationships->children('ns2',true) as $x){ $temp = array(); foreach($x->children() as $y){ foreach($y->children() as $z){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } } foreach($x->children('ns2',true) as $y){ $temp[$y->getName()] = (string)$y; } $this->data['Relationships'][$x->getName()][] = $temp; } } //CompetitivePricing if ($xml->CompetitivePricing){ //CompetitivePrices foreach($xml->CompetitivePricing->CompetitivePrices->children() as $pset){ $pnum = (string)$pset->CompetitivePriceId; $temp = (array)$pset->attributes(); $belongs = $temp['@attributes']['belongsToRequester']; $con = $temp['@attributes']['condition']; $sub = $temp['@attributes']['subcondition']; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['belongsToRequester'] = $belongs; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['condition'] = $con; $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['subcondition'] = $sub; foreach($pset->Price->children() as $x){ //CompetitivePrice->Price foreach($x->children() as $y){ $this->data['CompetitivePricing']['CompetitivePrices'][$pnum]['Price'][$x->getName()][$y->getName()] = (string)$y; } } $pnum++; } //NumberOfOfferListings if ($xml->CompetitivePricing->NumberOfOfferListings){ foreach($xml->CompetitivePricing->NumberOfOfferListings->children() as $x){ $temp = (array)$x->attributes(); $att = $temp['@attributes']['condition']; $this->data['CompetitivePricing']['NumberOfOfferListings'][$x->getName()][$att] = (string)$x; } } //TradeInValue if ($xml->CompetitivePricing->TradeInValue){ foreach($xml->CompetitivePricing->TradeInValue->children() as $x){ $this->data['CompetitivePricing']['TradeInValue'][$x->getName()] = (string)$x; } } } //SalesRankings if ($xml->SalesRankings){ foreach($xml->SalesRankings->children() as $x){ $temp = array(); foreach($x->children() as $y){ $temp[$y->getName()] = (string)$y; } $this->data['SalesRankings'][$x->getName()][] = $temp; } } //LowestOfferListings if ($xml->LowestOfferListings){ $lnum = 0; foreach($xml->LowestOfferListings->children() as $x){ //LowestOfferListing foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $this->data['LowestOfferListings'][$lnum][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $this->data['LowestOfferListings'][$lnum][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['LowestOfferListings'][$lnum][$y->getName()] = (string)$y; } } $lnum++; } } //Offers if ($xml->Offers){ $onum = 0; foreach($xml->Offers->children() as $x){ //Offer foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $this->data['Offers'][$onum][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $this->data['Offers'][$onum][$y->getName()][$z->getName()] = (string)$z; } } } else { $this->data['Offers'][$onum][$y->getName()] = (string)$y; } } $onum++; } } }
[ "public", "function", "loadXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "this", "->", "data", "=", "array", "(", ")", ";", "//Categories first", "if", "(", "$", "xml", "->", "getName", "...
Takes in XML data and converts it to an array for the object to use. @param SimpleXMLElement $xml <p>XML Product data from Amazon</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Takes", "in", "XML", "data", "and", "converts", "it", "to", "an", "array", "for", "the", "object", "to", "use", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProduct.php#L60-L277
CPIGroup/phpAmazonMWS
includes/classes/AmazonProduct.php
AmazonProduct.loadCategories
protected function loadCategories($xml){ //Categories if (!$xml->Self){ return false; } $cnum = 0; foreach($xml->children() as $x){ $this->data['Categories'][$cnum] = $this->genHierarchy($x); $cnum++; } }
php
protected function loadCategories($xml){ //Categories if (!$xml->Self){ return false; } $cnum = 0; foreach($xml->children() as $x){ $this->data['Categories'][$cnum] = $this->genHierarchy($x); $cnum++; } }
[ "protected", "function", "loadCategories", "(", "$", "xml", ")", "{", "//Categories", "if", "(", "!", "$", "xml", "->", "Self", ")", "{", "return", "false", ";", "}", "$", "cnum", "=", "0", ";", "foreach", "(", "$", "xml", "->", "children", "(", ")...
Takes in XML data for Categories and parses it for the object to use @param SimpleXMLElement $xml <p>The XML data from Amazon.</p> @return boolean <b>FALSE</b> if no valid XML data is found
[ "Takes", "in", "XML", "data", "for", "Categories", "and", "parses", "it", "for", "the", "object", "to", "use" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProduct.php#L284-L294
CPIGroup/phpAmazonMWS
includes/classes/AmazonProduct.php
AmazonProduct.loadLowestPricedOfferXml
protected function loadLowestPricedOfferXml($xml) { if (!$xml->Summary){ return false; } //Identifier foreach($xml->Identifier->children() as $x){ $this->data['Identifiers']['Identifier'][$x->getName()] = (string)$x; } //Summary $this->data['Summary']['TotalOfferCount'] = (string)$xml->Summary->TotalOfferCount; //Offer counts if ($xml->Summary->NumberOfOffers) { foreach($xml->Summary->NumberOfOffers->children() as $x){ $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['NumberOfOffers'][$tchannel][$tcondition] = (string)$x; } } //Lowest prices if ($xml->Summary->LowestPrices) { foreach($xml->Summary->LowestPrices->children() as $x){ $temp = array(); foreach($x->children() as $y) { foreach($y->children() as $z) { $temp[$y->getName()][$z->getName()] = (string)$z; } } $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['LowestPrices'][$tchannel][$tcondition] = $temp; } } //BuyBox prices if ($xml->Summary->BuyBoxPrices) { foreach($xml->Summary->BuyBoxPrices->children() as $x){ $temp = array(); foreach($x->children() as $y) { foreach($y->children() as $z) { $temp[$y->getName()][$z->getName()] = (string)$z; } } $att = (array)$x->attributes(); $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['BuyBoxPrices'][$tcondition] = $temp; } } //List price if ($xml->Summary->ListPrice) { foreach($xml->Summary->ListPrice->children() as $x) { $this->data['Summary']['ListPrice'][$x->getName()] = (string)$x; } } //Lower price with shipping if ($xml->Summary->SuggestedLowerPricePlusShipping) { foreach($xml->Summary->SuggestedLowerPricePlusShipping->children() as $x) { $this->data['Summary']['SuggestedLowerPricePlusShipping'][$x->getName()] = (string)$x; } } //BuyBox offers if ($xml->Summary->BuyBoxEligibleOffers) { foreach($xml->Summary->BuyBoxEligibleOffers->children() as $x) { $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['BuyBoxEligibleOffers'][$tchannel][$tcondition] = (string)$x; } } //Offers foreach($xml->Offers->children() as $x){ $temp = array(); //Offer foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $temp[$y->getName()][$z->getName()] = (string)$z; } } } else { if ($y->getName() == 'ShippingTime') { $att = (array)$y->attributes(); $temp['ShippingTime'] = array(); foreach ($att['@attributes'] as $zkey => $z) { $temp['ShippingTime'][$zkey] = $z; } } else { $temp[$y->getName()] = (string)$y; } } } $this->data['Offers'][] = $temp; } }
php
protected function loadLowestPricedOfferXml($xml) { if (!$xml->Summary){ return false; } //Identifier foreach($xml->Identifier->children() as $x){ $this->data['Identifiers']['Identifier'][$x->getName()] = (string)$x; } //Summary $this->data['Summary']['TotalOfferCount'] = (string)$xml->Summary->TotalOfferCount; //Offer counts if ($xml->Summary->NumberOfOffers) { foreach($xml->Summary->NumberOfOffers->children() as $x){ $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['NumberOfOffers'][$tchannel][$tcondition] = (string)$x; } } //Lowest prices if ($xml->Summary->LowestPrices) { foreach($xml->Summary->LowestPrices->children() as $x){ $temp = array(); foreach($x->children() as $y) { foreach($y->children() as $z) { $temp[$y->getName()][$z->getName()] = (string)$z; } } $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['LowestPrices'][$tchannel][$tcondition] = $temp; } } //BuyBox prices if ($xml->Summary->BuyBoxPrices) { foreach($xml->Summary->BuyBoxPrices->children() as $x){ $temp = array(); foreach($x->children() as $y) { foreach($y->children() as $z) { $temp[$y->getName()][$z->getName()] = (string)$z; } } $att = (array)$x->attributes(); $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['BuyBoxPrices'][$tcondition] = $temp; } } //List price if ($xml->Summary->ListPrice) { foreach($xml->Summary->ListPrice->children() as $x) { $this->data['Summary']['ListPrice'][$x->getName()] = (string)$x; } } //Lower price with shipping if ($xml->Summary->SuggestedLowerPricePlusShipping) { foreach($xml->Summary->SuggestedLowerPricePlusShipping->children() as $x) { $this->data['Summary']['SuggestedLowerPricePlusShipping'][$x->getName()] = (string)$x; } } //BuyBox offers if ($xml->Summary->BuyBoxEligibleOffers) { foreach($xml->Summary->BuyBoxEligibleOffers->children() as $x) { $att = (array)$x->attributes(); $tchannel = 'UnknownChannel'; if (isset($att['@attributes']['fulfillmentChannel'])) { $tchannel = $att['@attributes']['fulfillmentChannel']; } $tcondition = 'UnknownCondition'; if (isset($att['@attributes']['condition'])) { $tcondition = $att['@attributes']['condition']; } $this->data['Summary']['BuyBoxEligibleOffers'][$tchannel][$tcondition] = (string)$x; } } //Offers foreach($xml->Offers->children() as $x){ $temp = array(); //Offer foreach($x->children() as $y){ if ($y->children()->count() > 0){ foreach($y->children() as $z){ if ($z->children()->count() > 0){ foreach($z->children() as $zzz){ $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; } } else { $temp[$y->getName()][$z->getName()] = (string)$z; } } } else { if ($y->getName() == 'ShippingTime') { $att = (array)$y->attributes(); $temp['ShippingTime'] = array(); foreach ($att['@attributes'] as $zkey => $z) { $temp['ShippingTime'][$zkey] = $z; } } else { $temp[$y->getName()] = (string)$y; } } } $this->data['Offers'][] = $temp; } }
[ "protected", "function", "loadLowestPricedOfferXml", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", "->", "Summary", ")", "{", "return", "false", ";", "}", "//Identifier", "foreach", "(", "$", "xml", "->", "Identifier", "->", "children", "(", ")"...
Takes in XML data for lowest-priced offers and parses it for the object to use @param SimpleXMLElement $xml <p>The XML data from Amazon.</p> @return boolean <b>FALSE</b> if no valid XML data is found
[ "Takes", "in", "XML", "data", "for", "lowest", "-", "priced", "offers", "and", "parses", "it", "for", "the", "object", "to", "use" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProduct.php#L301-L423
CPIGroup/phpAmazonMWS
includes/classes/AmazonProduct.php
AmazonProduct.genHierarchy
protected function genHierarchy($xml){ if (!$xml){ return false; } $a = array(); $a['ProductCategoryId'] = (string)$xml->ProductCategoryId; $a['ProductCategoryName'] = (string)$xml->ProductCategoryName; if ($xml->Parent){ $a['Parent'] = $this->genHierarchy($xml->Parent); } return $a; }
php
protected function genHierarchy($xml){ if (!$xml){ return false; } $a = array(); $a['ProductCategoryId'] = (string)$xml->ProductCategoryId; $a['ProductCategoryName'] = (string)$xml->ProductCategoryName; if ($xml->Parent){ $a['Parent'] = $this->genHierarchy($xml->Parent); } return $a; }
[ "protected", "function", "genHierarchy", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "a", "=", "array", "(", ")", ";", "$", "a", "[", "'ProductCategoryId'", "]", "=", "(", "string", ")", "$",...
Recursively builds the hierarchy array. The returned array will have the fields <b>ProductCategoryId</b> and <b>ProductCategoryName</b>, as well as maybe a <b>Parent</b> field with the same structure as the array containing it. @param SimpleXMLElement $xml <p>The XML data from Amazon.</p> @return array Recursive, multi-dimensional array
[ "Recursively", "builds", "the", "hierarchy", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonProduct.php#L434-L445
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrder.php
AmazonOrder.fetchItems
public function fetchItems($token = false){ if (!isset($this->data['AmazonOrderId'])){ return false; } if (!is_bool($token)){ $token = false; } $items = new AmazonOrderItemList($this->storeName,$this->data['AmazonOrderId'],$this->mockMode,$this->mockFiles,$this->config); $items->setLogPath($this->logpath); $items->mockIndex = $this->mockIndex; $items->setUseToken($token); $items->fetchItems(); return $items; }
php
public function fetchItems($token = false){ if (!isset($this->data['AmazonOrderId'])){ return false; } if (!is_bool($token)){ $token = false; } $items = new AmazonOrderItemList($this->storeName,$this->data['AmazonOrderId'],$this->mockMode,$this->mockFiles,$this->config); $items->setLogPath($this->logpath); $items->mockIndex = $this->mockIndex; $items->setUseToken($token); $items->fetchItems(); return $items; }
[ "public", "function", "fetchItems", "(", "$", "token", "=", "false", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", "[", "'AmazonOrderId'", "]", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "is_bool", "(", "$", ...
Fetches items for the order from Amazon. See the <i>AmazonOrderItemList</i> class for more information on the returned object. @param boolean $token [optional] <p>whether or not to automatically use item tokens in the request</p> @return AmazonOrderItemList container for order's items
[ "Fetches", "items", "for", "the", "order", "from", "Amazon", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrder.php#L127-L140
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrder.php
AmazonOrder.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } $d = array(); $d['AmazonOrderId'] = (string)$xml->AmazonOrderId; if (isset($xml->SellerOrderId)){ $d['SellerOrderId'] = (string)$xml->SellerOrderId; } $d['PurchaseDate'] = (string)$xml->PurchaseDate; $d['LastUpdateDate'] = (string)$xml->LastUpdateDate; $d['OrderStatus'] = (string)$xml->OrderStatus; if (isset($xml->FulfillmentChannel)){ $d['FulfillmentChannel'] = (string)$xml->FulfillmentChannel; } if (isset($xml->SalesChannel)){ $d['SalesChannel'] = (string)$xml->SalesChannel; } if (isset($xml->OrderChannel)){ $d['OrderChannel'] = (string)$xml->OrderChannel; } if (isset($xml->ShipServiceLevel)){ $d['ShipServiceLevel'] = (string)$xml->ShipServiceLevel; } if (isset($xml->ShippingAddress)){ $d['ShippingAddress'] = array(); $d['ShippingAddress']['Name'] = (string)$xml->ShippingAddress->Name; $d['ShippingAddress']['AddressLine1'] = (string)$xml->ShippingAddress->AddressLine1; $d['ShippingAddress']['AddressLine2'] = (string)$xml->ShippingAddress->AddressLine2; $d['ShippingAddress']['AddressLine3'] = (string)$xml->ShippingAddress->AddressLine3; $d['ShippingAddress']['City'] = (string)$xml->ShippingAddress->City; $d['ShippingAddress']['County'] = (string)$xml->ShippingAddress->County; $d['ShippingAddress']['District'] = (string)$xml->ShippingAddress->District; $d['ShippingAddress']['StateOrRegion'] = (string)$xml->ShippingAddress->StateOrRegion; $d['ShippingAddress']['PostalCode'] = (string)$xml->ShippingAddress->PostalCode; $d['ShippingAddress']['CountryCode'] = (string)$xml->ShippingAddress->CountryCode; $d['ShippingAddress']['Phone'] = (string)$xml->ShippingAddress->Phone; } if (isset($xml->OrderTotal)){ $d['OrderTotal'] = array(); $d['OrderTotal']['Amount'] = (string)$xml->OrderTotal->Amount; $d['OrderTotal']['CurrencyCode'] = (string)$xml->OrderTotal->CurrencyCode; } if (isset($xml->NumberOfItemsShipped)){ $d['NumberOfItemsShipped'] = (string)$xml->NumberOfItemsShipped; } if (isset($xml->NumberOfItemsUnshipped)){ $d['NumberOfItemsUnshipped'] = (string)$xml->NumberOfItemsUnshipped; } if (isset($xml->PaymentExecutionDetail)){ $d['PaymentExecutionDetail'] = array(); $i = 0; foreach($xml->PaymentExecutionDetail->children() as $x){ $d['PaymentExecutionDetail'][$i]['Amount'] = (string)$x->Payment->Amount; $d['PaymentExecutionDetail'][$i]['CurrencyCode'] = (string)$x->Payment->CurrencyCode; $d['PaymentExecutionDetail'][$i]['SubPaymentMethod'] = (string)$x->SubPaymentMethod; $i++; } } if (isset($xml->PaymentMethod)){ $d['PaymentMethod'] = (string)$xml->PaymentMethod; } if (isset($xml->PaymentMethodDetails)){ foreach ($xml->PaymentMethodDetails as $x) { $d['PaymentMethodDetails'][] = (string)$x->PaymentMethodDetail; } } if (isset($xml->IsReplacementOrder)){ $d['IsReplacementOrder'] = (string)$xml->IsReplacementOrder; $d['ReplacedOrderId'] = (string)$xml->ReplacedOrderId; } $d['MarketplaceId'] = (string)$xml->MarketplaceId; if (isset($xml->BuyerName)){ $d['BuyerName'] = (string)$xml->BuyerName; } if (isset($xml->BuyerEmail)){ $d['BuyerEmail'] = (string)$xml->BuyerEmail; } if (isset($xml->BuyerCounty)){ $d['BuyerCounty'] = (string)$xml->BuyerCounty; } if (isset($xml->BuyerTaxInfo)){ $d['BuyerTaxInfo'] = array(); if (isset($xml->BuyerTaxInfo->CompanyLegalName)){ $d['BuyerTaxInfo']['CompanyLegalName'] = (string)$xml->BuyerTaxInfo->CompanyLegalName; } if (isset($xml->BuyerTaxInfo->TaxingRegion)){ $d['BuyerTaxInfo']['TaxingRegion'] = (string)$xml->BuyerTaxInfo->TaxingRegion; } if (isset($xml->BuyerTaxInfo->TaxClassifications)){ foreach($xml->BuyerTaxInfo->TaxClassifications->children() as $x){ $temp = array(); $temp['Name'] = (string)$x->Name; $temp['Value'] = (string)$x->Value; $d['BuyerTaxInfo']['TaxClassifications'][] = $temp; } } } if (isset($xml->ShipmentServiceLevelCategory)){ $d['ShipmentServiceLevelCategory'] = (string)$xml->ShipmentServiceLevelCategory; } if (isset($xml->CbaDisplayableShippingLabel)){ $d['CbaDisplayableShippingLabel'] = (string)$xml->CbaDisplayableShippingLabel; } if (isset($xml->ShippedByAmazonTFM)){ $d['ShippedByAmazonTFM'] = (string)$xml->ShippedByAmazonTFM; } if (isset($xml->TFMShipmentStatus)){ $d['TFMShipmentStatus'] = (string)$xml->TFMShipmentStatus; } if (isset($xml->OrderType)){ $d['OrderType'] = (string)$xml->OrderType; } if (isset($xml->EarliestShipDate)){ $d['EarliestShipDate'] = (string)$xml->EarliestShipDate; } if (isset($xml->LatestShipDate)){ $d['LatestShipDate'] = (string)$xml->LatestShipDate; } if (isset($xml->EarliestDeliveryDate)){ $d['EarliestDeliveryDate'] = (string)$xml->EarliestDeliveryDate; } if (isset($xml->LatestDeliveryDate)){ $d['LatestDeliveryDate'] = (string)$xml->LatestDeliveryDate; } if (isset($xml->IsBusinessOrder)){ $d['IsBusinessOrder'] = (string)$xml->IsBusinessOrder; } if (isset($xml->PurchaseOrderNumber)){ $d['PurchaseOrderNumber'] = (string)$xml->PurchaseOrderNumber; } if (isset($xml->IsPrime)){ $d['IsPrime'] = (string)$xml->IsPrime; } if (isset($xml->IsPremiumOrder)){ $d['IsPremiumOrder'] = (string)$xml->IsPremiumOrder; } $this->data = $d; }
php
protected function parseXML($xml){ if (!$xml){ return false; } $d = array(); $d['AmazonOrderId'] = (string)$xml->AmazonOrderId; if (isset($xml->SellerOrderId)){ $d['SellerOrderId'] = (string)$xml->SellerOrderId; } $d['PurchaseDate'] = (string)$xml->PurchaseDate; $d['LastUpdateDate'] = (string)$xml->LastUpdateDate; $d['OrderStatus'] = (string)$xml->OrderStatus; if (isset($xml->FulfillmentChannel)){ $d['FulfillmentChannel'] = (string)$xml->FulfillmentChannel; } if (isset($xml->SalesChannel)){ $d['SalesChannel'] = (string)$xml->SalesChannel; } if (isset($xml->OrderChannel)){ $d['OrderChannel'] = (string)$xml->OrderChannel; } if (isset($xml->ShipServiceLevel)){ $d['ShipServiceLevel'] = (string)$xml->ShipServiceLevel; } if (isset($xml->ShippingAddress)){ $d['ShippingAddress'] = array(); $d['ShippingAddress']['Name'] = (string)$xml->ShippingAddress->Name; $d['ShippingAddress']['AddressLine1'] = (string)$xml->ShippingAddress->AddressLine1; $d['ShippingAddress']['AddressLine2'] = (string)$xml->ShippingAddress->AddressLine2; $d['ShippingAddress']['AddressLine3'] = (string)$xml->ShippingAddress->AddressLine3; $d['ShippingAddress']['City'] = (string)$xml->ShippingAddress->City; $d['ShippingAddress']['County'] = (string)$xml->ShippingAddress->County; $d['ShippingAddress']['District'] = (string)$xml->ShippingAddress->District; $d['ShippingAddress']['StateOrRegion'] = (string)$xml->ShippingAddress->StateOrRegion; $d['ShippingAddress']['PostalCode'] = (string)$xml->ShippingAddress->PostalCode; $d['ShippingAddress']['CountryCode'] = (string)$xml->ShippingAddress->CountryCode; $d['ShippingAddress']['Phone'] = (string)$xml->ShippingAddress->Phone; } if (isset($xml->OrderTotal)){ $d['OrderTotal'] = array(); $d['OrderTotal']['Amount'] = (string)$xml->OrderTotal->Amount; $d['OrderTotal']['CurrencyCode'] = (string)$xml->OrderTotal->CurrencyCode; } if (isset($xml->NumberOfItemsShipped)){ $d['NumberOfItemsShipped'] = (string)$xml->NumberOfItemsShipped; } if (isset($xml->NumberOfItemsUnshipped)){ $d['NumberOfItemsUnshipped'] = (string)$xml->NumberOfItemsUnshipped; } if (isset($xml->PaymentExecutionDetail)){ $d['PaymentExecutionDetail'] = array(); $i = 0; foreach($xml->PaymentExecutionDetail->children() as $x){ $d['PaymentExecutionDetail'][$i]['Amount'] = (string)$x->Payment->Amount; $d['PaymentExecutionDetail'][$i]['CurrencyCode'] = (string)$x->Payment->CurrencyCode; $d['PaymentExecutionDetail'][$i]['SubPaymentMethod'] = (string)$x->SubPaymentMethod; $i++; } } if (isset($xml->PaymentMethod)){ $d['PaymentMethod'] = (string)$xml->PaymentMethod; } if (isset($xml->PaymentMethodDetails)){ foreach ($xml->PaymentMethodDetails as $x) { $d['PaymentMethodDetails'][] = (string)$x->PaymentMethodDetail; } } if (isset($xml->IsReplacementOrder)){ $d['IsReplacementOrder'] = (string)$xml->IsReplacementOrder; $d['ReplacedOrderId'] = (string)$xml->ReplacedOrderId; } $d['MarketplaceId'] = (string)$xml->MarketplaceId; if (isset($xml->BuyerName)){ $d['BuyerName'] = (string)$xml->BuyerName; } if (isset($xml->BuyerEmail)){ $d['BuyerEmail'] = (string)$xml->BuyerEmail; } if (isset($xml->BuyerCounty)){ $d['BuyerCounty'] = (string)$xml->BuyerCounty; } if (isset($xml->BuyerTaxInfo)){ $d['BuyerTaxInfo'] = array(); if (isset($xml->BuyerTaxInfo->CompanyLegalName)){ $d['BuyerTaxInfo']['CompanyLegalName'] = (string)$xml->BuyerTaxInfo->CompanyLegalName; } if (isset($xml->BuyerTaxInfo->TaxingRegion)){ $d['BuyerTaxInfo']['TaxingRegion'] = (string)$xml->BuyerTaxInfo->TaxingRegion; } if (isset($xml->BuyerTaxInfo->TaxClassifications)){ foreach($xml->BuyerTaxInfo->TaxClassifications->children() as $x){ $temp = array(); $temp['Name'] = (string)$x->Name; $temp['Value'] = (string)$x->Value; $d['BuyerTaxInfo']['TaxClassifications'][] = $temp; } } } if (isset($xml->ShipmentServiceLevelCategory)){ $d['ShipmentServiceLevelCategory'] = (string)$xml->ShipmentServiceLevelCategory; } if (isset($xml->CbaDisplayableShippingLabel)){ $d['CbaDisplayableShippingLabel'] = (string)$xml->CbaDisplayableShippingLabel; } if (isset($xml->ShippedByAmazonTFM)){ $d['ShippedByAmazonTFM'] = (string)$xml->ShippedByAmazonTFM; } if (isset($xml->TFMShipmentStatus)){ $d['TFMShipmentStatus'] = (string)$xml->TFMShipmentStatus; } if (isset($xml->OrderType)){ $d['OrderType'] = (string)$xml->OrderType; } if (isset($xml->EarliestShipDate)){ $d['EarliestShipDate'] = (string)$xml->EarliestShipDate; } if (isset($xml->LatestShipDate)){ $d['LatestShipDate'] = (string)$xml->LatestShipDate; } if (isset($xml->EarliestDeliveryDate)){ $d['EarliestDeliveryDate'] = (string)$xml->EarliestDeliveryDate; } if (isset($xml->LatestDeliveryDate)){ $d['LatestDeliveryDate'] = (string)$xml->LatestDeliveryDate; } if (isset($xml->IsBusinessOrder)){ $d['IsBusinessOrder'] = (string)$xml->IsBusinessOrder; } if (isset($xml->PurchaseOrderNumber)){ $d['PurchaseOrderNumber'] = (string)$xml->PurchaseOrderNumber; } if (isset($xml->IsPrime)){ $d['IsPrime'] = (string)$xml->IsPrime; } if (isset($xml->IsPremiumOrder)){ $d['IsPremiumOrder'] = (string)$xml->IsPremiumOrder; } $this->data = $d; }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "d", "=", "array", "(", ")", ";", "$", "d", "[", "'AmazonOrderId'", "]", "=", "(", "string", ")", "$", "xml"...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrder.php#L149-L289
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrder.php
AmazonOrder.getOrderTotalAmount
public function getOrderTotalAmount(){ if (isset($this->data['OrderTotal']) && isset($this->data['OrderTotal']['Amount'])){ return $this->data['OrderTotal']['Amount']; } else { return false; } }
php
public function getOrderTotalAmount(){ if (isset($this->data['OrderTotal']) && isset($this->data['OrderTotal']['Amount'])){ return $this->data['OrderTotal']['Amount']; } else { return false; } }
[ "public", "function", "getOrderTotalAmount", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "data", "[", "'OrderTotal'", "]", ")", "&&", "isset", "(", "$", "this", "->", "data", "[", "'OrderTotal'", "]", "[", "'Amount'", "]", ")", ")", "{...
Returns just the total cost of the Order. This method will return <b>FALSE</b> if the order total has not been set yet. @return string|boolean number, or <b>FALSE</b> if total not set yet
[ "Returns", "just", "the", "total", "cost", "of", "the", "Order", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrder.php#L534-L540
CPIGroup/phpAmazonMWS
includes/classes/AmazonOrder.php
AmazonOrder.getPercentShipped
public function getPercentShipped(){ if (isset($this->data['NumberOfItemsShipped']) && isset($this->data['NumberOfItemsUnshipped'])){ $total = $this->data['NumberOfItemsShipped'] + $this->data['NumberOfItemsUnshipped']; if ($total == 0){ return 0; } $ratio = $this->data['NumberOfItemsShipped'] / $total; return $ratio; } else { return false; } }
php
public function getPercentShipped(){ if (isset($this->data['NumberOfItemsShipped']) && isset($this->data['NumberOfItemsUnshipped'])){ $total = $this->data['NumberOfItemsShipped'] + $this->data['NumberOfItemsUnshipped']; if ($total == 0){ return 0; } $ratio = $this->data['NumberOfItemsShipped'] / $total; return $ratio; } else { return false; } }
[ "public", "function", "getPercentShipped", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "data", "[", "'NumberOfItemsShipped'", "]", ")", "&&", "isset", "(", "$", "this", "->", "data", "[", "'NumberOfItemsUnshipped'", "]", ")", ")", "{", "$"...
Returns the ratio of shipped items to unshipped items. This method will return <b>FALSE</b> if the shipment numbers have not been set yet. @return float|boolean Decimal number from 0 to 1, or <b>FALSE</b> if numbers not set yet
[ "Returns", "the", "ratio", "of", "shipped", "items", "to", "unshipped", "items", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonOrder.php#L897-L910
CPIGroup/phpAmazonMWS
includes/classes/AmazonFeedResult.php
AmazonFeedResult.fetchFeedResult
public function fetchFeedResult(){ if (!array_key_exists('FeedSubmissionId',$this->options)){ $this->log("Feed Submission ID must be set in order to fetch it!",'Warning'); return false; } $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); if ($this->mockMode){ $this->rawFeed = $this->fetchMockFile(false); } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $this->rawFeed = $response['body']; } }
php
public function fetchFeedResult(){ if (!array_key_exists('FeedSubmissionId',$this->options)){ $this->log("Feed Submission ID must be set in order to fetch it!",'Warning'); return false; } $url = $this->urlbase.$this->urlbranch; $query = $this->genQuery(); if ($this->mockMode){ $this->rawFeed = $this->fetchMockFile(false); } else { $response = $this->sendRequest($url, array('Post'=>$query)); if (!$this->checkResponse($response)){ return false; } $this->rawFeed = $response['body']; } }
[ "public", "function", "fetchFeedResult", "(", ")", "{", "if", "(", "!", "array_key_exists", "(", "'FeedSubmissionId'", ",", "$", "this", "->", "options", ")", ")", "{", "$", "this", "->", "log", "(", "\"Feed Submission ID must be set in order to fetch it!\"", ",",...
Sends a request to Amazon for a feed. Submits a <i>GetFeedSubmissionResult</i> request to Amazon. In order to do this, a feed submission ID is required. Amazon will send back the raw results of the feed as a response, which can be saved to a file using <i>saveFeed</i>. @return boolean <b>FALSE</b> if something goes wrong
[ "Sends", "a", "request", "to", "Amazon", "for", "a", "feed", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFeedResult.php#L89-L111
CPIGroup/phpAmazonMWS
includes/classes/AmazonFeedResult.php
AmazonFeedResult.saveFeed
public function saveFeed($path){ if (!isset($this->rawFeed)){ return false; } try{ file_put_contents($path,$this->rawFeed); $this->log("Successfully saved feed #".$this->options['FeedSubmissionId']." at $path"); } catch (Exception $e){ $this->log("Unable to save feed #".$this->options['FeedSubmissionId']." at $path: ".$e->getMessage(),'Urgent'); return false; } }
php
public function saveFeed($path){ if (!isset($this->rawFeed)){ return false; } try{ file_put_contents($path,$this->rawFeed); $this->log("Successfully saved feed #".$this->options['FeedSubmissionId']." at $path"); } catch (Exception $e){ $this->log("Unable to save feed #".$this->options['FeedSubmissionId']." at $path: ".$e->getMessage(),'Urgent'); return false; } }
[ "public", "function", "saveFeed", "(", "$", "path", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "rawFeed", ")", ")", "{", "return", "false", ";", "}", "try", "{", "file_put_contents", "(", "$", "path", ",", "$", "this", "->", "rawFee...
Saves the raw report data to a path you specify. This method will record in the log whether or not the save was successful. @param string $path <p>path for the file to save the feed data in</p> @return boolean <b>FALSE</b> if something goes wrong
[ "Saves", "the", "raw", "report", "data", "to", "a", "path", "you", "specify", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFeedResult.php#L120-L131
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.prepareToken
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListMarketplaceParticipationsByNextToken'; } else { $this->options['Action'] = 'ListMarketplaceParticipations'; unset($this->options['NextToken']); $this->marketplaceList = array(); $this->participationList = array(); $this->indexM = 0; $this->indexP = 0; } }
php
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListMarketplaceParticipationsByNextToken'; } else { $this->options['Action'] = 'ListMarketplaceParticipations'; unset($this->options['NextToken']); $this->marketplaceList = array(); $this->participationList = array(); $this->indexM = 0; $this->indexP = 0; } }
[ "protected", "function", "prepareToken", "(", ")", "{", "if", "(", "$", "this", "->", "tokenFlag", "&&", "$", "this", "->", "tokenUseFlag", ")", "{", "$", "this", "->", "options", "[", "'Action'", "]", "=", "'ListMarketplaceParticipationsByNextToken'", ";", ...
Sets up options for using tokens. This changes key options for switching between simply fetching a list and fetching the rest of a list using a token. Please note: because the operation for using tokens does not use any other parameters, all other parameters will be removed.
[ "Sets", "up", "options", "for", "using", "tokens", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L140-L151
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } $xmlP = $xml->ListParticipations; $xmlM = $xml->ListMarketplaces; foreach($xmlP->children() as $x){ $this->participationList[$this->indexP]['MarketplaceId'] = (string)$x->MarketplaceId; $this->participationList[$this->indexP]['SellerId'] = (string)$x->SellerId; $this->participationList[$this->indexP]['Suspended'] = (string)$x->HasSellerSuspendedListings; $this->indexP++; } foreach($xmlM->children() as $x){ $this->marketplaceList[$this->indexM]['MarketplaceId'] = (string)$x->MarketplaceId; $this->marketplaceList[$this->indexM]['Name'] = (string)$x->Name; $this->marketplaceList[$this->indexM]['Country'] = (string)$x->DefaultCountryCode; $this->marketplaceList[$this->indexM]['Currency'] = (string)$x->DefaultCurrencyCode; $this->marketplaceList[$this->indexM]['Language'] = (string)$x->DefaultLanguageCode; $this->marketplaceList[$this->indexM]['Domain'] = (string)$x->DomainName; $this->indexM++; } }
php
protected function parseXML($xml){ if (!$xml){ return false; } $xmlP = $xml->ListParticipations; $xmlM = $xml->ListMarketplaces; foreach($xmlP->children() as $x){ $this->participationList[$this->indexP]['MarketplaceId'] = (string)$x->MarketplaceId; $this->participationList[$this->indexP]['SellerId'] = (string)$x->SellerId; $this->participationList[$this->indexP]['Suspended'] = (string)$x->HasSellerSuspendedListings; $this->indexP++; } foreach($xmlM->children() as $x){ $this->marketplaceList[$this->indexM]['MarketplaceId'] = (string)$x->MarketplaceId; $this->marketplaceList[$this->indexM]['Name'] = (string)$x->Name; $this->marketplaceList[$this->indexM]['Country'] = (string)$x->DefaultCountryCode; $this->marketplaceList[$this->indexM]['Currency'] = (string)$x->DefaultCurrencyCode; $this->marketplaceList[$this->indexM]['Language'] = (string)$x->DefaultLanguageCode; $this->marketplaceList[$this->indexM]['Domain'] = (string)$x->DomainName; $this->indexM++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "xmlP", "=", "$", "xml", "->", "ListParticipations", ";", "$", "xmlM", "=", "$", "xml", "->", "ListMarketplaces", ...
Parses XML response into two arrays. This is what reads the response XML and converts it into two arrays. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "two", "arrays", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L160-L184
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getMarketplaceId
public function getMarketplaceId($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['MarketplaceId']; } else { return false; } }
php
public function getMarketplaceId($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['MarketplaceId']; } else { return false; } }
[ "public", "function", "getMarketplaceId", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_k...
Returns the marketplace ID for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "marketplace", "ID", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L234-L243
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getName
public function getName($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Name']; } else { return false; } }
php
public function getName($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Name']; } else { return false; } }
[ "public", "function", "getName", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_exists...
Returns the marketplace name for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "marketplace", "name", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L252-L261
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getCountry
public function getCountry($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Country']; } else { return false; } }
php
public function getCountry($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Country']; } else { return false; } }
[ "public", "function", "getCountry", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_exi...
Returns the country code for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "country", "code", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L270-L279
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getCurreny
public function getCurreny($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Currency']; } else { return false; } }
php
public function getCurreny($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Currency']; } else { return false; } }
[ "public", "function", "getCurreny", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_exi...
Returns the default currency code for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "default", "currency", "code", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L288-L297
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getLanguage
public function getLanguage($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Language']; } else { return false; } }
php
public function getLanguage($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Language']; } else { return false; } }
[ "public", "function", "getLanguage", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_ex...
Returns the default language code for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "default", "language", "code", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L306-L315
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getDomain
public function getDomain($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Domain']; } else { return false; } }
php
public function getDomain($i = 0){ if (!isset($this->marketplaceList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->marketplaceList)){ return $this->marketplaceList[$i]['Domain']; } else { return false; } }
[ "public", "function", "getDomain", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "marketplaceList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_exis...
Returns the domain name for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "domain", "name", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L324-L333
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getSellerId
public function getSellerId($i = 0){ if (!isset($this->participationList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->participationList)){ return $this->participationList[$i]['SellerId']; } else { return false; } }
php
public function getSellerId($i = 0){ if (!isset($this->participationList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->participationList)){ return $this->participationList[$i]['SellerId']; } else { return false; } }
[ "public", "function", "getSellerId", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "participationList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "array_key_...
Returns the seller ID for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "seller", "ID", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L342-L351
CPIGroup/phpAmazonMWS
includes/classes/AmazonParticipationList.php
AmazonParticipationList.getSuspensionStatus
public function getSuspensionStatus($i = 0){ if (!isset($this->participationList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->participationList)){ return $this->participationList[$i]['Suspended']; } else { return false; } }
php
public function getSuspensionStatus($i = 0){ if (!isset($this->participationList)){ return false; } if (is_numeric($i) && array_key_exists($i, $this->participationList)){ return $this->participationList[$i]['Suspended']; } else { return false; } }
[ "public", "function", "getSuspensionStatus", "(", "$", "i", "=", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "participationList", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_numeric", "(", "$", "i", ")", "&&", "ar...
Returns the suspension status for the specified entry. This method will return <b>FALSE</b> if the list has not yet been filled. @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p> @return string|boolean "Yes" or "No", or <b>FALSE</b> if Non-numeric index
[ "Returns", "the", "suspension", "status", "for", "the", "specified", "entry", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonParticipationList.php#L360-L369
CPIGroup/phpAmazonMWS
includes/classes/AmazonServiceStatus.php
AmazonServiceStatus.setService
public function setService($s){ if (file_exists($this->env)){ include($this->env); } else { return false; } if (is_null($s)){ $this->log("Service cannot be null",'Warning'); return false; } if (is_bool($s)){ $this->log("A boolean is not a service",'Warning'); return false; } switch($s){ case 'Inbound': if(isset($AMAZON_VERSION_INBOUND)){ $this->urlbranch = 'FulfillmentInboundShipment/'.$AMAZON_VERSION_INBOUND; $this->options['Version'] = $AMAZON_VERSION_INBOUND; $this->ready = true; } return true; case 'Inventory': if(isset($AMAZON_VERSION_INVENTORY)){ $this->urlbranch = 'FulfillmentInventory/'.$AMAZON_VERSION_INVENTORY; $this->options['Version'] = $AMAZON_VERSION_INVENTORY; $this->ready = true; } return true; case 'Orders': if(isset($AMAZON_VERSION_ORDERS)){ $this->urlbranch = 'Orders/'.$AMAZON_VERSION_ORDERS; $this->options['Version'] = $AMAZON_VERSION_ORDERS; $this->ready = true; } return true; case 'Outbound': if(isset($AMAZON_VERSION_OUTBOUND)){ $this->urlbranch = 'FulfillmentOutboundShipment/'.$AMAZON_VERSION_OUTBOUND; $this->options['Version'] = $AMAZON_VERSION_OUTBOUND; $this->ready = true; } return true; case 'Products': if(isset($AMAZON_VERSION_PRODUCTS)){ $this->urlbranch = 'Products/'.$AMAZON_VERSION_PRODUCTS; $this->options['Version'] = $AMAZON_VERSION_PRODUCTS; $this->ready = true; } return true; case 'Sellers': if(isset($AMAZON_VERSION_SELLERS)){ $this->urlbranch = 'Sellers/'.$AMAZON_VERSION_SELLERS; $this->options['Version'] = $AMAZON_VERSION_SELLERS; $this->ready = true; } return true; default: $this->log("$s is not a valid service",'Warning'); return false; } }
php
public function setService($s){ if (file_exists($this->env)){ include($this->env); } else { return false; } if (is_null($s)){ $this->log("Service cannot be null",'Warning'); return false; } if (is_bool($s)){ $this->log("A boolean is not a service",'Warning'); return false; } switch($s){ case 'Inbound': if(isset($AMAZON_VERSION_INBOUND)){ $this->urlbranch = 'FulfillmentInboundShipment/'.$AMAZON_VERSION_INBOUND; $this->options['Version'] = $AMAZON_VERSION_INBOUND; $this->ready = true; } return true; case 'Inventory': if(isset($AMAZON_VERSION_INVENTORY)){ $this->urlbranch = 'FulfillmentInventory/'.$AMAZON_VERSION_INVENTORY; $this->options['Version'] = $AMAZON_VERSION_INVENTORY; $this->ready = true; } return true; case 'Orders': if(isset($AMAZON_VERSION_ORDERS)){ $this->urlbranch = 'Orders/'.$AMAZON_VERSION_ORDERS; $this->options['Version'] = $AMAZON_VERSION_ORDERS; $this->ready = true; } return true; case 'Outbound': if(isset($AMAZON_VERSION_OUTBOUND)){ $this->urlbranch = 'FulfillmentOutboundShipment/'.$AMAZON_VERSION_OUTBOUND; $this->options['Version'] = $AMAZON_VERSION_OUTBOUND; $this->ready = true; } return true; case 'Products': if(isset($AMAZON_VERSION_PRODUCTS)){ $this->urlbranch = 'Products/'.$AMAZON_VERSION_PRODUCTS; $this->options['Version'] = $AMAZON_VERSION_PRODUCTS; $this->ready = true; } return true; case 'Sellers': if(isset($AMAZON_VERSION_SELLERS)){ $this->urlbranch = 'Sellers/'.$AMAZON_VERSION_SELLERS; $this->options['Version'] = $AMAZON_VERSION_SELLERS; $this->ready = true; } return true; default: $this->log("$s is not a valid service",'Warning'); return false; } }
[ "public", "function", "setService", "(", "$", "s", ")", "{", "if", "(", "file_exists", "(", "$", "this", "->", "env", ")", ")", "{", "include", "(", "$", "this", "->", "env", ")", ";", "}", "else", "{", "return", "false", ";", "}", "if", "(", "...
Set the service to fetch the status of. (Required) This method sets the service for the object to check in the next request. This parameter is required for fetching the service status from Amazon. The list of valid services to check is as follows: <ul> <li>Inbound</li> <li>Inventory</li> <li>Orders</li> <li>Outbound</li> <li>Products</li> <li>Sellers</li> </ul> @param string $s <p>See list.</p> @return boolean <b>TRUE</b> if valid input, <b>FALSE</b> if improper input
[ "Set", "the", "service", "to", "fetch", "the", "status", "of", ".", "(", "Required", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonServiceStatus.php#L84-L149
CPIGroup/phpAmazonMWS
includes/classes/AmazonServiceStatus.php
AmazonServiceStatus.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } $this->lastTimestamp = (string)$xml->Timestamp; $this->status = (string)$xml->Status; if ($this->status == 'GREEN_I'){ $this->messageId = (string)$xml->MessageId; $i = 0; foreach ($xml->Messages->children() as $x){ $this->messageList[$i] = (string)$x->Text; $i++; } } }
php
protected function parseXML($xml){ if (!$xml){ return false; } $this->lastTimestamp = (string)$xml->Timestamp; $this->status = (string)$xml->Status; if ($this->status == 'GREEN_I'){ $this->messageId = (string)$xml->MessageId; $i = 0; foreach ($xml->Messages->children() as $x){ $this->messageList[$i] = (string)$x->Text; $i++; } } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "$", "this", "->", "lastTimestamp", "=", "(", "string", ")", "$", "xml", "->", "Timestamp", ";", "$", "this", "->", ...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonServiceStatus.php#L193-L208
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentOrderList.php
AmazonFulfillmentOrderList.setStartTime
public function setStartTime($s){ if (is_string($s)){ $time = $this->genTime($s); $this->options['QueryStartDateTime'] = $time; } else { return false; } }
php
public function setStartTime($s){ if (is_string($s)){ $time = $this->genTime($s); $this->options['QueryStartDateTime'] = $time; } else { return false; } }
[ "public", "function", "setStartTime", "(", "$", "s", ")", "{", "if", "(", "is_string", "(", "$", "s", ")", ")", "{", "$", "time", "=", "$", "this", "->", "genTime", "(", "$", "s", ")", ";", "$", "this", "->", "options", "[", "'QueryStartDateTime'",...
Sets the start time. (Optional) This method sets the earliest time frame to be sent in the next request. If this parameter is set, Amazon will only return fulfillment orders that were last updated after the time set. If this parameter is not set, Amazon will only return orders that were updated in the past 36 hours. The parameter is passed through <i>strtotime</i>, so values such as "-1 hour" are fine. @param string $s <p>Time string.</p> @return boolean <b>FALSE</b> if improper input
[ "Sets", "the", "start", "time", ".", "(", "Optional", ")" ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentOrderList.php#L64-L71
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentOrderList.php
AmazonFulfillmentOrderList.prepareToken
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListAllFulfillmentOrdersByNextToken'; unset($this->options['QueryStartDateTime']); } else { $this->options['Action'] = 'ListAllFulfillmentOrders'; unset($this->options['NextToken']); $this->orderList = array(); $this->index = 0; } }
php
protected function prepareToken(){ if ($this->tokenFlag && $this->tokenUseFlag){ $this->options['Action'] = 'ListAllFulfillmentOrdersByNextToken'; unset($this->options['QueryStartDateTime']); } else { $this->options['Action'] = 'ListAllFulfillmentOrders'; unset($this->options['NextToken']); $this->orderList = array(); $this->index = 0; } }
[ "protected", "function", "prepareToken", "(", ")", "{", "if", "(", "$", "this", "->", "tokenFlag", "&&", "$", "this", "->", "tokenUseFlag", ")", "{", "$", "this", "->", "options", "[", "'Action'", "]", "=", "'ListAllFulfillmentOrdersByNextToken'", ";", "unse...
Sets up options for using tokens. This changes key options for switching between simply fetching a list and fetching the rest of a list using a token. Please note: because the operation for using tokens does not use any other parameters, all other parameters will be removed.
[ "Sets", "up", "options", "for", "using", "tokens", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentOrderList.php#L162-L172
CPIGroup/phpAmazonMWS
includes/classes/AmazonFulfillmentOrderList.php
AmazonFulfillmentOrderList.parseXML
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $x){ $i = $this->index; $this->orderList[$i]['SellerFulfillmentOrderId'] = (string)$x->SellerFulfillmentOrderId; $this->orderList[$i]['MarketplaceId'] = (string)$x->MarketplaceId; $this->orderList[$i]['DisplayableOrderId'] = (string)$x->DisplayableOrderId; $this->orderList[$i]['DisplayableOrderDateTime'] = (string)$x->DisplayableOrderDateTime; $this->orderList[$i]['DisplayableOrderComment'] = (string)$x->DisplayableOrderComment; $this->orderList[$i]['ShippingSpeedCategory'] = (string)$x->ShippingSpeedCategory; if (isset($x->DeliveryWindow)) { $this->orderList[$i]['DeliveryWindow']['StartDateTime'] = (string)$x->DeliveryWindow->StartDateTime; $this->orderList[$i]['DeliveryWindow']['EndDateTime'] = (string)$x->DeliveryWindow->EndDateTime; } if (isset($x->DestinationAddress)){ $this->orderList[$i]['DestinationAddress']['Name'] = (string)$x->DestinationAddress->Name; $this->orderList[$i]['DestinationAddress']['Line1'] = (string)$x->DestinationAddress->Line1; if (isset($x->DestinationAddress->Line2)){ $this->orderList[$i]['DestinationAddress']['Line2'] = (string)$x->DestinationAddress->Line2; } if (isset($x->DestinationAddress->Line3)){ $this->orderList[$i]['DestinationAddress']['Line3'] = (string)$x->DestinationAddress->Line3; } if (isset($x->DestinationAddress->DistrictOrCounty)){ $this->orderList[$i]['DestinationAddress']['DistrictOrCounty'] = (string)$x->DestinationAddress->DistrictOrCounty; } $this->orderList[$i]['DestinationAddress']['City'] = (string)$x->DestinationAddress->City; $this->orderList[$i]['DestinationAddress']['StateOrProvinceCode'] = (string)$x->DestinationAddress->StateOrProvinceCode; $this->orderList[$i]['DestinationAddress']['CountryCode'] = (string)$x->DestinationAddress->CountryCode; if (isset($x->DestinationAddress->PostalCode)){ $this->orderList[$i]['DestinationAddress']['PostalCode'] = (string)$x->DestinationAddress->PostalCode; } if (isset($x->DestinationAddress->PhoneNumber)){ $this->orderList[$i]['DestinationAddress']['PhoneNumber'] = (string)$x->DestinationAddress->PhoneNumber; } } if (isset($x->FulfillmentAction)){ $this->orderList[$i]['FulfillmentAction'] = (string)$x->FulfillmentAction; } if (isset($x->FulfillmentPolicy)){ $this->orderList[$i]['FulfillmentPolicy'] = (string)$x->FulfillmentPolicy; } if (isset($x->FulfillmentMethod)){ //deprecated $this->orderList[$i]['FulfillmentMethod'] = (string)$x->FulfillmentMethod; } $this->orderList[$i]['ReceivedDateTime'] = (string)$x->ReceivedDateTime; $this->orderList[$i]['FulfillmentOrderStatus'] = (string)$x->FulfillmentOrderStatus; $this->orderList[$i]['StatusUpdatedDateTime'] = (string)$x->StatusUpdatedDateTime; if (isset($x->NotificationEmailList)){ $j = 0; foreach($x->NotificationEmailList->children() as $y){ $this->orderList[$i]['NotificationEmailList'][$j++] = (string)$y; } } if (isset($x->CODSettings->IsCODRequired)){ $this->orderList[$i]['CODSettings']['IsCODRequired'] = (string)$x->CODSettings->IsCODRequired; } if (isset($x->CODSettings->CODCharge)){ $this->orderList[$i]['CODSettings']['CODCharge']['CurrencyCode'] = (string)$x->CODSettings->CODCharge->CurrencyCode; $this->orderList[$i]['CODSettings']['CODCharge']['Value'] = (string)$x->CODSettings->CODCharge->Value; } if (isset($x->CODSettings->CODChargeTax)){ $this->orderList[$i]['CODSettings']['CODChargeTax']['CurrencyCode'] = (string)$x->CODSettings->CODChargeTax->CurrencyCode; $this->orderList[$i]['CODSettings']['CODChargeTax']['Value'] = (string)$x->CODSettings->CODChargeTax->Value; } if (isset($x->CODSettings->ShippingCharge)){ $this->orderList[$i]['CODSettings']['ShippingCharge']['CurrencyCode'] = (string)$x->CODSettings->ShippingCharge->CurrencyCode; $this->orderList[$i]['CODSettings']['ShippingCharge']['Value'] = (string)$x->CODSettings->ShippingCharge->Value; } if (isset($x->CODSettings->ShippingChargeTax)){ $this->orderList[$i]['CODSettings']['ShippingChargeTax']['CurrencyCode'] = (string)$x->CODSettings->ShippingChargeTax->CurrencyCode; $this->orderList[$i]['CODSettings']['ShippingChargeTax']['Value'] = (string)$x->CODSettings->ShippingChargeTax->Value; } $this->index++; } }
php
protected function parseXML($xml){ if (!$xml){ return false; } foreach($xml->children() as $x){ $i = $this->index; $this->orderList[$i]['SellerFulfillmentOrderId'] = (string)$x->SellerFulfillmentOrderId; $this->orderList[$i]['MarketplaceId'] = (string)$x->MarketplaceId; $this->orderList[$i]['DisplayableOrderId'] = (string)$x->DisplayableOrderId; $this->orderList[$i]['DisplayableOrderDateTime'] = (string)$x->DisplayableOrderDateTime; $this->orderList[$i]['DisplayableOrderComment'] = (string)$x->DisplayableOrderComment; $this->orderList[$i]['ShippingSpeedCategory'] = (string)$x->ShippingSpeedCategory; if (isset($x->DeliveryWindow)) { $this->orderList[$i]['DeliveryWindow']['StartDateTime'] = (string)$x->DeliveryWindow->StartDateTime; $this->orderList[$i]['DeliveryWindow']['EndDateTime'] = (string)$x->DeliveryWindow->EndDateTime; } if (isset($x->DestinationAddress)){ $this->orderList[$i]['DestinationAddress']['Name'] = (string)$x->DestinationAddress->Name; $this->orderList[$i]['DestinationAddress']['Line1'] = (string)$x->DestinationAddress->Line1; if (isset($x->DestinationAddress->Line2)){ $this->orderList[$i]['DestinationAddress']['Line2'] = (string)$x->DestinationAddress->Line2; } if (isset($x->DestinationAddress->Line3)){ $this->orderList[$i]['DestinationAddress']['Line3'] = (string)$x->DestinationAddress->Line3; } if (isset($x->DestinationAddress->DistrictOrCounty)){ $this->orderList[$i]['DestinationAddress']['DistrictOrCounty'] = (string)$x->DestinationAddress->DistrictOrCounty; } $this->orderList[$i]['DestinationAddress']['City'] = (string)$x->DestinationAddress->City; $this->orderList[$i]['DestinationAddress']['StateOrProvinceCode'] = (string)$x->DestinationAddress->StateOrProvinceCode; $this->orderList[$i]['DestinationAddress']['CountryCode'] = (string)$x->DestinationAddress->CountryCode; if (isset($x->DestinationAddress->PostalCode)){ $this->orderList[$i]['DestinationAddress']['PostalCode'] = (string)$x->DestinationAddress->PostalCode; } if (isset($x->DestinationAddress->PhoneNumber)){ $this->orderList[$i]['DestinationAddress']['PhoneNumber'] = (string)$x->DestinationAddress->PhoneNumber; } } if (isset($x->FulfillmentAction)){ $this->orderList[$i]['FulfillmentAction'] = (string)$x->FulfillmentAction; } if (isset($x->FulfillmentPolicy)){ $this->orderList[$i]['FulfillmentPolicy'] = (string)$x->FulfillmentPolicy; } if (isset($x->FulfillmentMethod)){ //deprecated $this->orderList[$i]['FulfillmentMethod'] = (string)$x->FulfillmentMethod; } $this->orderList[$i]['ReceivedDateTime'] = (string)$x->ReceivedDateTime; $this->orderList[$i]['FulfillmentOrderStatus'] = (string)$x->FulfillmentOrderStatus; $this->orderList[$i]['StatusUpdatedDateTime'] = (string)$x->StatusUpdatedDateTime; if (isset($x->NotificationEmailList)){ $j = 0; foreach($x->NotificationEmailList->children() as $y){ $this->orderList[$i]['NotificationEmailList'][$j++] = (string)$y; } } if (isset($x->CODSettings->IsCODRequired)){ $this->orderList[$i]['CODSettings']['IsCODRequired'] = (string)$x->CODSettings->IsCODRequired; } if (isset($x->CODSettings->CODCharge)){ $this->orderList[$i]['CODSettings']['CODCharge']['CurrencyCode'] = (string)$x->CODSettings->CODCharge->CurrencyCode; $this->orderList[$i]['CODSettings']['CODCharge']['Value'] = (string)$x->CODSettings->CODCharge->Value; } if (isset($x->CODSettings->CODChargeTax)){ $this->orderList[$i]['CODSettings']['CODChargeTax']['CurrencyCode'] = (string)$x->CODSettings->CODChargeTax->CurrencyCode; $this->orderList[$i]['CODSettings']['CODChargeTax']['Value'] = (string)$x->CODSettings->CODChargeTax->Value; } if (isset($x->CODSettings->ShippingCharge)){ $this->orderList[$i]['CODSettings']['ShippingCharge']['CurrencyCode'] = (string)$x->CODSettings->ShippingCharge->CurrencyCode; $this->orderList[$i]['CODSettings']['ShippingCharge']['Value'] = (string)$x->CODSettings->ShippingCharge->Value; } if (isset($x->CODSettings->ShippingChargeTax)){ $this->orderList[$i]['CODSettings']['ShippingChargeTax']['CurrencyCode'] = (string)$x->CODSettings->ShippingChargeTax->CurrencyCode; $this->orderList[$i]['CODSettings']['ShippingChargeTax']['Value'] = (string)$x->CODSettings->ShippingChargeTax->Value; } $this->index++; } }
[ "protected", "function", "parseXML", "(", "$", "xml", ")", "{", "if", "(", "!", "$", "xml", ")", "{", "return", "false", ";", "}", "foreach", "(", "$", "xml", "->", "children", "(", ")", "as", "$", "x", ")", "{", "$", "i", "=", "$", "this", "...
Parses XML response into array. This is what reads the response XML and converts it into an array. @param SimpleXMLElement $xml <p>The XML response from Amazon.</p> @return boolean <b>FALSE</b> if no XML data is found
[ "Parses", "XML", "response", "into", "array", "." ]
train
https://github.com/CPIGroup/phpAmazonMWS/blob/bf594dcb60e3176ec69148e90bd9e618f41a85d3/includes/classes/AmazonFulfillmentOrderList.php#L181-L259