File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 24
24
* required. This object can use tokens when retrieving the list.
25
25
*/
26
26
class AmazonOrderItemList extends AmazonOrderCore implements Iterator{
27
+ protected $ orderId ;
27
28
protected $ itemList ;
28
29
protected $ tokenFlag = false ;
29
30
protected $ tokenUseFlag = false ;
@@ -140,8 +141,10 @@ public function fetchItems($r = true){
140
141
if (is_null ($ xml ->AmazonOrderId )){
141
142
$ this ->log ("You just got throttled. " ,'Warning ' );
142
143
return false ;
143
- } else if (isset ($ this ->options ['AmazonOrderId ' ]) && $ this ->options ['AmazonOrderId ' ] && $ this ->options ['AmazonOrderId ' ] != $ xml ->AmazonOrderId ){
144
- $ this ->log ('You grabbed the wrong Order \'s items! - ' .$ this ->options ['AmazonOrderId ' ].' =/= ' .$ xml ->AmazonOrderId ,'Urgent ' );
144
+ }
145
+ $ this ->orderId = (string )$ xml ->AmazonOrderId ;
146
+ if (!empty ($ this ->options ['AmazonOrderId ' ]) && $ this ->options ['AmazonOrderId ' ] != $ this ->orderId ){
147
+ $ this ->log ('You grabbed the wrong Order \'s items! - ' .$ this ->options ['AmazonOrderId ' ].' =/= ' .$ this ->orderId ,'Urgent ' );
145
148
}
146
149
147
150
$ this ->parseXML ($ xml ->OrderItems );
@@ -297,6 +300,20 @@ protected function parseXML($xml){
297
300
}
298
301
299
302
}
303
+
304
+ /**
305
+ * Returns the order ID for the items.
306
+ *
307
+ * This method will return <b>FALSE</b> if the list has not yet been filled.
308
+ * @return string|boolean single value, or <b>FALSE</b> if not set yet
309
+ */
310
+ public function getOrderId (){
311
+ if (isset ($ this ->orderId )){
312
+ return $ this ->orderId ;
313
+ } else {
314
+ return false ;
315
+ }
316
+ }
300
317
301
318
/**
302
319
* Returns the specified order item, or all of them.
You can’t perform that action at this time.
0 commit comments