diff --git a/INSTALL.md b/INSTALL.md index 1da0fff4..668b6e68 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -44,7 +44,7 @@ function getAmazonOrders() { This example shows a function used to send a previously-created XML feed to Amazon to update Inventory numbers: ```php function sendInventoryFeed($feed) { - $amz=new AmazonFeed("myStore"); //store name matches the array key in the config file + $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation $amz->setFeedContent($feed); $amz->submitFeed(); diff --git a/README.md b/README.md index 00e3f164..13ad8358 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ function getAmazonOrders() { This example shows a function used to send a previously-created XML feed to Amazon to update Inventory numbers: ```php function sendInventoryFeed($feed) { - $amz=new AmazonFeed("myStore"); //store name matches the array key in the config file + $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation $amz->setFeedContent($feed); $amz->submitFeed(); diff --git a/amazon-config.default.php b/amazon-config.default.php index 0deb552b..8f1874a9 100644 --- a/amazon-config.default.php +++ b/amazon-config.default.php @@ -21,6 +21,7 @@ $store['YourAmazonStore']['marketplaceId'] = ''; //Marketplace ID for this store $store['YourAmazonStore']['keyId'] = ''; //Access Key ID $store['YourAmazonStore']['secretKey'] = ''; //Secret Access Key for this store +$store['YourAmazonStore']['serviceUrl'] = ''; //optional override for Service URL //Service URL Base //Current setting is United States diff --git a/examples/feed_examples.php b/examples/feed_examples.php index 21af4a30..0bb7a6c1 100644 --- a/examples/feed_examples.php +++ b/examples/feed_examples.php @@ -43,7 +43,7 @@ function getAmazonFeedStatus(){ */ function sendInventoryFeed($feed) { try { - $amz=new AmazonFeed("myStore"); //store name matches the array key in the config file + $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation $amz->setFeedContent($feed); //can be either XML or CSV data; a file upload method is available as well $amz->submitFeed(); //this is what actually sends the request diff --git a/includes/classes/AmazonCore.php b/includes/classes/AmazonCore.php index 0e95959f..42d0b00b 100644 --- a/includes/classes/AmazonCore.php +++ b/includes/classes/AmazonCore.php @@ -112,8 +112,9 @@ abstract class AmazonCore{ * * This constructor is called when initializing all objects in this library. * The parameters are passed by the child objects' constructors. - * @param string $s
Name for the store you want to use as seen in the config file. - * If this is not set to a valid name, none of these objects will work.
+ * @param string $s [optional]Name for the store you want to use as seen in the config file. + * If there is only one store defined in the config file, this parameter is not necessary. + * If there is more than one store and this is not set to a valid name, none of these objects will work.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * When this is set to TRUE, the object will fetch responses from * files you specify instead of sending the requests to Amazon. @@ -124,7 +125,7 @@ abstract class AmazonCore{ * from the list to use as a response. See setMock for more information.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - protected function __construct($s, $mock=false, $m = null, $config = null){ + protected function __construct($s = null, $mock = false, $m = null, $config = null){ if (is_null($config)){ $config = __DIR__.'/../../amazon-config.php'; } @@ -360,8 +361,9 @@ public function setConfig($path){ include($path); $this->config = $path; $this->setLogPath($logpath); - if (isset($AMAZON_SERVICE_URL)) - $this->urlbase = $AMAZON_SERVICE_URL; + if (isset($AMAZON_SERVICE_URL)) { + $this->urlbase = $AMAZON_SERVICE_URL; + } } else { throw new Exception("Config file does not exist or cannot be read! ($path)"); } @@ -392,16 +394,25 @@ public function setLogPath($path){ * for making requests with Amazon. If the store cannot be found in the * config file, or if any of the key values are missing, * the incident will be logged. - * @param string $sThe store name to look for.
+ * @param string $s [optional]The store name to look for. + * This parameter is not required if there is only one store defined in the config file.
* @throws Exception If the file can't be found. */ - public function setStore($s){ + public function setStore($s=null){ if (file_exists($this->config)){ include($this->config); } else { throw new Exception("Config file does not exist!"); } + if (empty($store) || !is_array($store)) { + throw new Exception("No stores defined!"); + } + + if (!isset($s) && count($store)===1) { + $s=key($store); + } + if(array_key_exists($s, $store)){ $this->storeName = $s; if(array_key_exists('merchantId', $store[$s])){ @@ -417,6 +428,9 @@ public function setStore($s){ if(!array_key_exists('secretKey', $store[$s])){ $this->log("Secret Key is missing!",'Warning'); } + if (!empty($store[$s]['serviceUrl'])) { + $this->urlbase = $store[$s]['serviceUrl']; + } } else { $this->log("Store $s does not exist!",'Warning'); @@ -499,7 +513,7 @@ protected function log($msg, $level = 'Info'){ file_put_contents($this->logpath, "This is the Amazon log, for Amazon classes to use.\n"); } if (file_exists($this->logpath) && is_writable($this->logpath)){ - $str = "[$level][" . date("Y/m/d h:i:s", mktime()) . " $name@$ip $fileName:$line $function] " . $msg; + $str = "[$level][" . date("Y/m/d H:i:s") . " $name@$ip $fileName:$line $function] " . $msg; $fd = fopen($this->logpath, "a+"); fwrite($fd,$str . "\r\n"); fclose($fd); diff --git a/includes/classes/AmazonFeed.php b/includes/classes/AmazonFeed.php index 67f6302f..34e3b52a 100644 --- a/includes/classes/AmazonFeed.php +++ b/includes/classes/AmazonFeed.php @@ -35,13 +35,14 @@ class AmazonFeed extends AmazonFeedsCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); @@ -301,32 +302,6 @@ protected function genHeader(){ return $return; } - /** - * Checks whether or not the response is OK. - * - * Verifies whether or not the HTTP response has the 200 OK code. If the code - * is not 200, the incident and error message returned are logged. This method - * is different than the ones used by other objects due to Amazon sending - * 100 Continue responses in addition to the usual response. - * @param array $rThe HTTP response array. Expects the array to have - * the fields code, body, and error.
- * @return boolean TRUE if the status is 200 OK, FALSE otherwise. - */ - protected function checkResponse($r){ - if (!is_array($r)){ - $this->log("No Response found",'Warning'); - return false; - } - //for dealing with 100 response - if (array_key_exists('error', $r) && $r['ok'] == 0){ - $this->log("Response Not OK! Error: ".$r['error'],'Urgent'); - return false; - } else { - $this->log("Response OK!"); - return true; - } - } - /** * Returns the response data in array. * diff --git a/includes/classes/AmazonFeedList.php b/includes/classes/AmazonFeedList.php index 6b2ccca7..580ede2d 100644 --- a/includes/classes/AmazonFeedList.php +++ b/includes/classes/AmazonFeedList.php @@ -40,13 +40,14 @@ class AmazonFeedList extends AmazonFeedsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonFeedResult.php b/includes/classes/AmazonFeedResult.php index cd008455..eda8cce1 100644 --- a/includes/classes/AmazonFeedResult.php +++ b/includes/classes/AmazonFeedResult.php @@ -35,14 +35,15 @@ class AmazonFeedResult extends AmazonFeedsCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The Feed Submission ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonFeedsCore.php b/includes/classes/AmazonFeedsCore.php index 249d4456..3cbb145b 100644 --- a/includes/classes/AmazonFeedsCore.php +++ b/includes/classes/AmazonFeedsCore.php @@ -30,13 +30,14 @@ abstract class AmazonFeedsCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonFulfillmentOrder.php b/includes/classes/AmazonFulfillmentOrder.php index d0b099eb..05081bde 100644 --- a/includes/classes/AmazonFulfillmentOrder.php +++ b/includes/classes/AmazonFulfillmentOrder.php @@ -35,14 +35,15 @@ class AmazonFulfillmentOrder extends AmazonOutboundCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The Fulfillment Order ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); if($id){ diff --git a/includes/classes/AmazonFulfillmentOrderCreator.php b/includes/classes/AmazonFulfillmentOrderCreator.php index f1993d14..9bb1e691 100644 --- a/includes/classes/AmazonFulfillmentOrderCreator.php +++ b/includes/classes/AmazonFulfillmentOrderCreator.php @@ -32,13 +32,14 @@ class AmazonFulfillmentOrderCreator extends AmazonOutboundCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); $this->options['Action'] = 'CreateFulfillmentOrder'; diff --git a/includes/classes/AmazonFulfillmentOrderList.php b/includes/classes/AmazonFulfillmentOrderList.php index c89b8d85..a84a23a7 100644 --- a/includes/classes/AmazonFulfillmentOrderList.php +++ b/includes/classes/AmazonFulfillmentOrderList.php @@ -37,13 +37,14 @@ class AmazonFulfillmentOrderList extends AmazonOutboundCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); $this->options['Action'] = 'ListAllFulfillmentOrders'; diff --git a/includes/classes/AmazonFulfillmentPreview.php b/includes/classes/AmazonFulfillmentPreview.php index e1ae9950..28782972 100644 --- a/includes/classes/AmazonFulfillmentPreview.php +++ b/includes/classes/AmazonFulfillmentPreview.php @@ -32,13 +32,14 @@ class AmazonFulfillmentPreview extends AmazonOutboundCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); $this->options['Action'] = 'GetFulfillmentPreview'; diff --git a/includes/classes/AmazonInboundCore.php b/includes/classes/AmazonInboundCore.php index 62b755fc..bb23e28b 100644 --- a/includes/classes/AmazonInboundCore.php +++ b/includes/classes/AmazonInboundCore.php @@ -30,13 +30,14 @@ abstract class AmazonInboundCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonInventoryCore.php b/includes/classes/AmazonInventoryCore.php index f8245d09..1f17abad 100644 --- a/includes/classes/AmazonInventoryCore.php +++ b/includes/classes/AmazonInventoryCore.php @@ -30,13 +30,14 @@ abstract class AmazonInventoryCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonInventoryList.php b/includes/classes/AmazonInventoryList.php index 8e65f93b..6705e6e9 100644 --- a/includes/classes/AmazonInventoryList.php +++ b/includes/classes/AmazonInventoryList.php @@ -36,13 +36,14 @@ class AmazonInventoryList extends AmazonInventoryCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); } @@ -246,7 +247,7 @@ protected function parseXML($xml){ $this->supplyList[$this->index]['EarliestAvailability'] = (string)$x->EarliestAvailability->TimepointType; } } - if (isset($this->options['ResponseGroup']) && $this->options['ResponseGroup'] == 'Detailed'){ + 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'){ diff --git a/includes/classes/AmazonOrder.php b/includes/classes/AmazonOrder.php index adbdf463..28f3ccd6 100644 --- a/includes/classes/AmazonOrder.php +++ b/includes/classes/AmazonOrder.php @@ -34,7 +34,8 @@ class AmazonOrder extends AmazonOrderCore{ * on these parameters and common methods. * Please note that two extra parameters come before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The Order ID to set for the object.
* @param SimpleXMLElement $data [optional]XML data from Amazon to be parsed.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. @@ -42,7 +43,7 @@ class AmazonOrder extends AmazonOrderCore{ * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $data = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $id = null, $data = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); @@ -218,6 +219,18 @@ protected function parseXML($xml){ if (isset($xml->ShipServiceLevelCategory)){ $d['ShipServiceLevelCategory'] = (string)$xml->ShipServiceLevelCategory; } + 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; } @@ -591,6 +604,78 @@ public function getShipServiceLevelCategory(){ } } + /** + * Returns the customized Checkout by Amazon (CBA) label of the Order. + * + * This method will return FALSE if the CBA label category has not been set yet. + * @return string|boolean single value, or FALSE if label not set yet + */ + public function getCbaDisplayableShippingLabel(){ + if (isset($this->data['CbaDisplayableShippingLabel'])){ + return $this->data['CbaDisplayableShippingLabel']; + } else { + return false; + } + } + + /** + * Returns an indication of whether or not the Order was shipped with the Amazon TFM service. + * + * This method will return FALSE if the status has not been set yet. + * @return string|boolean single value, or FALSE if value not set yet + */ + public function getShippedByAmazonTfm(){ + if (isset($this->data['ShippedByAmazonTFM'])){ + return $this->data['ShippedByAmazonTFM']; + } else { + return false; + } + } + + /** + * Returns the status of an Order shipped using Amazon TFM. + * + * This method will return FALSE if the status has not been set yet. + * Valid values for the status are... + *Name for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonOrderItemList.php b/includes/classes/AmazonOrderItemList.php index 93f7f2ed..f2140abd 100644 --- a/includes/classes/AmazonOrderItemList.php +++ b/includes/classes/AmazonOrderItemList.php @@ -38,14 +38,15 @@ class AmazonOrderItemList extends AmazonOrderCore implements Iterator{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The order ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id=null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $id=null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); @@ -252,6 +253,35 @@ protected function parseXML($xml){ $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++; } @@ -607,7 +637,7 @@ public function getPromotionDiscount($i = 0, $only = false){ } /** - * Returns specified promotion ID for specified item. + * Returns specified promotion ID for the specified item. * * This method will return the entire list of Promotion IDs if $j is not set. * @param int $i [optional]List index to retrieve the value from. Defaults to 0.
@@ -624,7 +654,129 @@ public function getPromotionIds($i = 0, $j = null){ } else { return false; } - + } + + /** + * Returns invoice data for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * The array for invoice data may have the following fields: + *List index to retrieve the value from. Defaults to 0.
+ * @return array|boolean array, or FALSE if incorrect index + */ + public function getInvoiceData($i = 0){ + if (isset($this->itemList[$i]['InvoiceData'])){ + return $this->itemList[$i]['InvoiceData']; + } else { + return false; + } + } + + /** + * Returns the condition for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * Possible values for the condition ID are... + *List index to retrieve the value from. Defaults to 0.
+ * @return string|boolean single value, or FALSE if incorrect index + */ + public function getConditionId($i = 0){ + if (isset($this->itemList[$i]['ConditionId'])){ + return $this->itemList[$i]['ConditionId']; + } else { + return false; + } + } + + /** + * Returns the subcondition for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * Possible values for the subcondition ID are... + *List index to retrieve the value from. Defaults to 0.
+ * @return string|boolean single value, or FALSE if incorrect index + */ + public function getConditionSubtypeId($i = 0){ + if (isset($this->itemList[$i]['ConditionSubtypeId'])){ + return $this->itemList[$i]['ConditionSubtypeId']; + } else { + return false; + } + } + + /** + * Returns the condition description for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * @param int $i [optional]List index to retrieve the value from. Defaults to 0.
+ * @return string|boolean single value, or FALSE if incorrect index + */ + public function getConditionNote($i = 0){ + if (isset($this->itemList[$i]['ConditionNote'])){ + return $this->itemList[$i]['ConditionNote']; + } else { + return false; + } + } + + /** + * Returns the earliest date in the scheduled delivery window for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * @param int $i [optional]List index to retrieve the value from. Defaults to 0.
+ * @return string|boolean single value, or FALSE if incorrect index + */ + public function getScheduledDeliveryStartDate($i = 0){ + if (isset($this->itemList[$i]['ScheduledDeliveryStartDate'])){ + return $this->itemList[$i]['ScheduledDeliveryStartDate']; + } else { + return false; + } + } + + /** + * Returns the latest date in the scheduled delivery window for the specified item. + * + * This method will return FALSE if the list has not yet been filled. + * @param int $i [optional]List index to retrieve the value from. Defaults to 0.
+ * @return string|boolean single value, or FALSE if incorrect index + */ + public function getScheduledDeliveryEndDate($i = 0){ + if (isset($this->itemList[$i]['ScheduledDeliveryEndDate'])){ + return $this->itemList[$i]['ScheduledDeliveryEndDate']; + } else { + return false; + } } /** diff --git a/includes/classes/AmazonOrderList.php b/includes/classes/AmazonOrderList.php index b4eba584..b498d70d 100644 --- a/includes/classes/AmazonOrderList.php +++ b/includes/classes/AmazonOrderList.php @@ -37,13 +37,14 @@ class AmazonOrderList extends AmazonOrderCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); if (file_exists($this->config)){ @@ -52,8 +53,8 @@ public function __construct($s, $mock = false, $m = null, $config = null){ throw new Exception('Config file does not exist!'); } - if(isset($store[$s]) && array_key_exists('marketplaceId', $store[$s])){ - $this->options['MarketplaceId.Id.1'] = $store[$s]['marketplaceId']; + if(isset($store[$this->storeName]) && array_key_exists('marketplaceId', $store[$this->storeName])){ + $this->options['MarketplaceId.Id.1'] = $store[$this->storeName]['marketplaceId']; } else { $this->log("Marketplace ID is missing",'Urgent'); } diff --git a/includes/classes/AmazonOrderSet.php b/includes/classes/AmazonOrderSet.php index 9f08ac86..569f130e 100644 --- a/includes/classes/AmazonOrderSet.php +++ b/includes/classes/AmazonOrderSet.php @@ -37,14 +37,15 @@ class AmazonOrderSet extends AmazonOrderCore implements Iterator{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $o [optional]The Order IDs to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $o = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $o = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); $this->i = 0; include($this->env); diff --git a/includes/classes/AmazonOutboundCore.php b/includes/classes/AmazonOutboundCore.php index 8473a1d3..12e79047 100644 --- a/includes/classes/AmazonOutboundCore.php +++ b/includes/classes/AmazonOutboundCore.php @@ -30,13 +30,14 @@ abstract class AmazonOutboundCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonPackageTracker.php b/includes/classes/AmazonPackageTracker.php index 075c4913..d8734db5 100644 --- a/includes/classes/AmazonPackageTracker.php +++ b/includes/classes/AmazonPackageTracker.php @@ -33,14 +33,15 @@ class AmazonPackageTracker extends AmazonOutboundCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The package ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); if($id){ diff --git a/includes/classes/AmazonParticipationList.php b/includes/classes/AmazonParticipationList.php index c7f09218..9f2c8b36 100644 --- a/includes/classes/AmazonParticipationList.php +++ b/includes/classes/AmazonParticipationList.php @@ -37,13 +37,14 @@ class AmazonParticipationList extends AmazonSellersCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonProduct.php b/includes/classes/AmazonProduct.php index 50619c30..107bcdd4 100644 --- a/includes/classes/AmazonProduct.php +++ b/includes/classes/AmazonProduct.php @@ -33,14 +33,15 @@ class AmazonProduct extends AmazonProductsCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param SimpleXMLElement $data [optional]XML data from Amazon to be parsed.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $data = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $data = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); if ($data){ @@ -141,6 +142,16 @@ public function loadXML($xml){ } } } + //child relations use namespace but parent does not + foreach($xml->Relationships->children('ns2',true) as $x){ + foreach($x->children() as $y){ + foreach($y->children() as $z){ + foreach($z->children() as $zzz){ + $this->data['Relationships'][$x->getName()][$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz; + } + } + } + } } //CompetitivePricing @@ -291,7 +302,7 @@ protected function genHierarchy($xml){ * See getData. * @return array Huge array of Product data. */ - public function getProduct(){ + public function getProduct($num=null){ return $this->getData(); } diff --git a/includes/classes/AmazonProductInfo.php b/includes/classes/AmazonProductInfo.php index 63e2d219..faa16a82 100644 --- a/includes/classes/AmazonProductInfo.php +++ b/includes/classes/AmazonProductInfo.php @@ -34,13 +34,14 @@ class AmazonProductInfo extends AmazonProductsCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); } @@ -83,6 +84,8 @@ private function resetSKUs(){ unset($this->options[$op]); } } + //remove Category-specific name + unset($this->options['SellerSKU']); } /** @@ -124,6 +127,8 @@ private function resetASINs(){ unset($this->options[$op]); } } + //remove Category-specific name + unset($this->options['ASIN']); } /** @@ -393,9 +398,11 @@ protected function prepareCategories(){ if (array_key_exists('SellerSKUList.SellerSKU.1',$this->options)){ $this->options['Action'] = 'GetProductCategoriesForSKU'; $this->resetASINs(); + $this->options['SellerSKU'] = $this->options['SellerSKUList.SellerSKU.1']; } else if (array_key_exists('ASINList.ASIN.1',$this->options)){ $this->options['Action'] = 'GetProductCategoriesForASIN'; $this->resetSKUs(); + $this->options['ASIN'] = $this->options['ASINList.ASIN.1']; } } diff --git a/includes/classes/AmazonProductList.php b/includes/classes/AmazonProductList.php index 32c10afb..e1a78b6a 100644 --- a/includes/classes/AmazonProductList.php +++ b/includes/classes/AmazonProductList.php @@ -32,13 +32,14 @@ class AmazonProductList extends AmazonProductsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonProductSearch.php b/includes/classes/AmazonProductSearch.php index ec2d8a4b..44e9c266 100644 --- a/includes/classes/AmazonProductSearch.php +++ b/includes/classes/AmazonProductSearch.php @@ -35,14 +35,15 @@ class AmazonProductSearch extends AmazonProductsCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $q [optional]The query string to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $q = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $q = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonProductsCore.php b/includes/classes/AmazonProductsCore.php index b8f4fc32..5a6d7af5 100644 --- a/includes/classes/AmazonProductsCore.php +++ b/includes/classes/AmazonProductsCore.php @@ -33,13 +33,14 @@ abstract class AmazonProductsCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); if (file_exists($this->config)){ @@ -54,8 +55,8 @@ public function __construct($s, $mock = false, $m = null, $config = null){ } - if(isset($store[$s]) && array_key_exists('marketplaceId', $store[$s])){ - $this->options['MarketplaceId'] = $store[$s]['marketplaceId']; + if(isset($store[$this->storeName]) && array_key_exists('marketplaceId', $store[$this->storeName])){ + $this->options['MarketplaceId'] = $store[$this->storeName]['marketplaceId']; } else { $this->log("Marketplace ID is missing",'Urgent'); } diff --git a/includes/classes/AmazonReport.php b/includes/classes/AmazonReport.php index cfbe0cda..061358b1 100644 --- a/includes/classes/AmazonReport.php +++ b/includes/classes/AmazonReport.php @@ -34,14 +34,15 @@ class AmazonReport extends AmazonReportsCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The report ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportAcknowledger.php b/includes/classes/AmazonReportAcknowledger.php index 231ee409..13ca1437 100644 --- a/includes/classes/AmazonReportAcknowledger.php +++ b/includes/classes/AmazonReportAcknowledger.php @@ -37,14 +37,15 @@ class AmazonReportAcknowledger extends AmazonReportsCore implements Iterator{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param array|string $id [optional]The report ID(s) to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportList.php b/includes/classes/AmazonReportList.php index 661e209f..22bf7e8e 100644 --- a/includes/classes/AmazonReportList.php +++ b/includes/classes/AmazonReportList.php @@ -37,13 +37,14 @@ class AmazonReportList extends AmazonReportsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportRequest.php b/includes/classes/AmazonReportRequest.php index c230e9b4..c06d1789 100644 --- a/includes/classes/AmazonReportRequest.php +++ b/includes/classes/AmazonReportRequest.php @@ -32,13 +32,14 @@ class AmazonReportRequest extends AmazonReportsCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportRequestList.php b/includes/classes/AmazonReportRequestList.php index 18f0f584..52d29201 100644 --- a/includes/classes/AmazonReportRequestList.php +++ b/includes/classes/AmazonReportRequestList.php @@ -39,13 +39,14 @@ class AmazonReportRequestList extends AmazonReportsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportScheduleList.php b/includes/classes/AmazonReportScheduleList.php index fab3145b..751a39ee 100644 --- a/includes/classes/AmazonReportScheduleList.php +++ b/includes/classes/AmazonReportScheduleList.php @@ -39,13 +39,14 @@ class AmazonReportScheduleList extends AmazonReportsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportScheduleManager.php b/includes/classes/AmazonReportScheduleManager.php index dc1e4453..c62c896b 100644 --- a/includes/classes/AmazonReportScheduleManager.php +++ b/includes/classes/AmazonReportScheduleManager.php @@ -37,13 +37,14 @@ class AmazonReportScheduleManager extends AmazonReportsCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonReportsCore.php b/includes/classes/AmazonReportsCore.php index 9d0c4c9a..3501998f 100644 --- a/includes/classes/AmazonReportsCore.php +++ b/includes/classes/AmazonReportsCore.php @@ -30,13 +30,14 @@ abstract class AmazonReportsCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonSellersCore.php b/includes/classes/AmazonSellersCore.php index 720f9a7f..53376e28 100644 --- a/includes/classes/AmazonSellersCore.php +++ b/includes/classes/AmazonSellersCore.php @@ -30,13 +30,14 @@ abstract class AmazonSellersCore extends AmazonCore{ * The parameters are passed by the child objects' constructors, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonServiceStatus.php b/includes/classes/AmazonServiceStatus.php index 0f5bebed..46007753 100644 --- a/includes/classes/AmazonServiceStatus.php +++ b/includes/classes/AmazonServiceStatus.php @@ -37,14 +37,15 @@ class AmazonServiceStatus extends AmazonCore{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $service [optional]The service to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $service = null, $mock = false, $m = null, $config = null){ + public function __construct($s = null, $service = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); include($this->env); diff --git a/includes/classes/AmazonShipment.php b/includes/classes/AmazonShipment.php index a669d856..9021d3b1 100644 --- a/includes/classes/AmazonShipment.php +++ b/includes/classes/AmazonShipment.php @@ -33,13 +33,14 @@ class AmazonShipment extends AmazonInboundCore{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); $this->options['InboundShipmentHeader.ShipmentStatus'] = 'WORKING'; diff --git a/includes/classes/AmazonShipmentItemList.php b/includes/classes/AmazonShipmentItemList.php index 6c314eeb..348528a1 100644 --- a/includes/classes/AmazonShipmentItemList.php +++ b/includes/classes/AmazonShipmentItemList.php @@ -38,14 +38,15 @@ class AmazonShipmentItemList extends AmazonInboundCore implements Iterator{ * on these parameters and common methods. * Please note that an extra parameter comes before the usual Mock Mode parameters, * so be careful when setting up the object. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param string $id [optional]The order ID to set for the object.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $id = null, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $id = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); if ($id){ diff --git a/includes/classes/AmazonShipmentList.php b/includes/classes/AmazonShipmentList.php index 0dc7dfeb..d49e3a7d 100644 --- a/includes/classes/AmazonShipmentList.php +++ b/includes/classes/AmazonShipmentList.php @@ -36,13 +36,14 @@ class AmazonShipmentList extends AmazonInboundCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); } diff --git a/includes/classes/AmazonShipmentPlanner.php b/includes/classes/AmazonShipmentPlanner.php index b090e87c..7945bb56 100644 --- a/includes/classes/AmazonShipmentPlanner.php +++ b/includes/classes/AmazonShipmentPlanner.php @@ -33,13 +33,14 @@ class AmazonShipmentPlanner extends AmazonInboundCore implements Iterator{ * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $sName for the store you want to use.
+ * @param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
*/ - public function __construct($s, $mock = false, $m = null, $config = null) { + public function __construct($s = null, $mock = false, $m = null, $config = null) { parent::__construct($s, $mock, $m, $config); $this->options['Action'] = 'CreateInboundShipmentPlan'; diff --git a/nbproject/project.properties b/nbproject/project.properties index 74c6d3aa..c9e83d69 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -6,12 +6,9 @@ auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_path= auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_path= auxiliary.org-netbeans-modules-php-phpunit.test_2e_groups_2e_ask=false auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_all=false -file.reference.athena-includes=../../includes -file.reference.athena-includes-1=../../../includes ignore.path= include.path=\ - ${php.global.include.path}:\ - ${file.reference.athena-includes-1} + ${php.global.include.path} php.version=PHP_54 source.encoding=UTF-8 src.dir=.