@@ -35,12 +35,14 @@ class AmazonPrepInfo extends AmazonInboundCore implements Iterator
35
35
protected $ i = 0 ;
36
36
37
37
/**
38
- * Sets the seller SKU(s). (Required*)
38
+ * Sets the seller SKU(s). (Required*).
39
39
*
40
40
* This method sets the list of seller SKUs to be sent in the next request.
41
41
* If this parameter is set, ASINs cannot be set.
42
+ *
42
43
* @param array|string $s <p>A list of Seller SKUs, or a single SKU string. (max: 20)</p>
43
- * @return boolean <b>FALSE</b> if improper input
44
+ *
45
+ * @return bool <b>FALSE</b> if improper input
44
46
*/
45
47
public function setSkus ($ s )
46
48
{
@@ -69,19 +71,21 @@ public function setSkus($s)
69
71
private function resetSkus ()
70
72
{
71
73
foreach ($ this ->options as $ op =>$ junk ) {
72
- if (preg_match (" #SellerSKUList# " , $ op )) {
74
+ if (preg_match (' #SellerSKUList# ' , $ op )) {
73
75
unset($ this ->options [$ op ]);
74
76
}
75
77
}
76
78
}
77
79
78
80
/**
79
- * Sets the ASIN(s). (Required*)
81
+ * Sets the ASIN(s). (Required*).
80
82
*
81
83
* This method sets the list of ASINs to be sent in the next request.
82
84
* If this parameter is set, Seller SKUs cannot be set.
85
+ *
83
86
* @param array|string $s <p>A list of ASINs, or a single ASIN string. (max: 20)</p>
84
- * @return boolean <b>FALSE</b> if improper input
87
+ *
88
+ * @return bool <b>FALSE</b> if improper input
85
89
*/
86
90
public function setAsins ($ s )
87
91
{
@@ -110,7 +114,7 @@ public function setAsins($s)
110
114
private function resetAsins ()
111
115
{
112
116
foreach ($ this ->options as $ op =>$ junk ) {
113
- if (preg_match (" #ASINList# " , $ op )) {
117
+ if (preg_match (' #ASINList# ' , $ op )) {
114
118
unset($ this ->options [$ op ]);
115
119
}
116
120
}
@@ -126,13 +130,15 @@ private function resetAsins()
126
130
* Other methods are available for fetching specific values from the list.
127
131
* A list of items that were deemed invalid can also be retrieved using
128
132
* <i>getInvalidItemList</i>.
129
- * @return boolean <b>FALSE</b> if something goes wrong
133
+ *
134
+ * @return bool <b>FALSE</b> if something goes wrong
130
135
*/
131
136
public function fetchPrepInstructions ()
132
137
{
133
138
if (!array_key_exists ('SellerSKUList.Id.1 ' , $ this ->options ) &&
134
139
!array_key_exists ('ASINList.Id.1 ' , $ this ->options )) {
135
- $ this ->log ("Product IDs must be set in order to get prep instructions! " , 'Warning ' );
140
+ $ this ->log ('Product IDs must be set in order to get prep instructions! ' , 'Warning ' );
141
+
136
142
return false ;
137
143
}
138
144
@@ -181,8 +187,10 @@ protected function preparePrep()
181
187
* Parses XML response into array.
182
188
*
183
189
* This is what reads the response XML and converts it into an array.
190
+ *
184
191
* @param SimpleXMLElement $xml <p>The XML response from Amazon.</p>
185
- * @return boolean <b>FALSE</b> if no XML data is found
192
+ *
193
+ * @return bool <b>FALSE</b> if no XML data is found
186
194
*/
187
195
protected function parseXml ($ xml )
188
196
{
@@ -202,20 +210,20 @@ protected function parseXml($xml)
202
210
foreach ($ list ->children () as $ x ) {
203
211
$ temp = [];
204
212
if (isset ($ x ->SellerSKU )) {
205
- $ temp ['SellerSKU ' ] = (string )$ x ->SellerSKU ;
213
+ $ temp ['SellerSKU ' ] = (string ) $ x ->SellerSKU ;
206
214
}
207
- $ temp ['ASIN ' ] = (string )$ x ->ASIN ;
208
- $ temp ['BarcodeInstruction ' ] = (string )$ x ->BarcodeInstruction ;
209
- $ temp ['PrepGuidance ' ] = (string )$ x ->PrepGuidance ;
215
+ $ temp ['ASIN ' ] = (string ) $ x ->ASIN ;
216
+ $ temp ['BarcodeInstruction ' ] = (string ) $ x ->BarcodeInstruction ;
217
+ $ temp ['PrepGuidance ' ] = (string ) $ x ->PrepGuidance ;
210
218
foreach ($ x ->PrepInstructionList ->children () as $ z ) {
211
- $ temp ['PrepInstructionList ' ][] = (string )$ z ;
219
+ $ temp ['PrepInstructionList ' ][] = (string ) $ z ;
212
220
}
213
221
if (isset ($ x ->AmazonPrepFeesDetailsList )) {
214
222
foreach ($ x ->AmazonPrepFeesDetailsList ->children () as $ z ) {
215
223
$ fee = [];
216
- $ fee ['PrepInstruction ' ] = (string )$ z ->PrepInstruction ;
217
- $ fee ['Amount ' ]['Value ' ] = (string )$ z ->Amount ->Value ;
218
- $ fee ['Amount ' ]['CurrencyCode ' ] = (string )$ z ->Amount ->CurrencyCode ;
224
+ $ fee ['PrepInstruction ' ] = (string ) $ z ->PrepInstruction ;
225
+ $ fee ['Amount ' ]['Value ' ] = (string ) $ z ->Amount ->Value ;
226
+ $ fee ['Amount ' ]['CurrencyCode ' ] = (string ) $ z ->Amount ->CurrencyCode ;
219
227
$ temp ['AmazonPrepFees ' ][] = $ fee ;
220
228
}
221
229
}
@@ -234,12 +242,12 @@ protected function parseXml($xml)
234
242
if ($ invList ) {
235
243
foreach ($ invList ->children () as $ x ) {
236
244
$ temp = [];
237
- $ temp ['ErrorReason ' ] = (string )$ x ->ErrorReason ;
245
+ $ temp ['ErrorReason ' ] = (string ) $ x ->ErrorReason ;
238
246
if (isset ($ x ->SellerSKU )) {
239
- $ temp ['SellerSKU ' ] = (string )$ x ->SellerSKU ;
247
+ $ temp ['SellerSKU ' ] = (string ) $ x ->SellerSKU ;
240
248
}
241
249
if (isset ($ x ->ASIN )) {
242
- $ temp ['ASIN ' ] = (string )$ x ->ASIN ;
250
+ $ temp ['ASIN ' ] = (string ) $ x ->ASIN ;
243
251
}
244
252
$ this ->invalidList [] = $ temp ;
245
253
}
@@ -252,8 +260,10 @@ protected function parseXml($xml)
252
260
* Prep instructions will only include this data if SKUs were sent when
253
261
* retrieving the list of prep instructions.
254
262
* This method will return <b>FALSE</b> if the list has not yet been filled.
263
+ *
255
264
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
256
- * @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
265
+ *
266
+ * @return string|bool single value, or <b>FALSE</b> if Non-numeric index
257
267
*/
258
268
public function getSku ($ i = 0 )
259
269
{
@@ -268,8 +278,10 @@ public function getSku($i = 0)
268
278
* Returns the ASIN for the specified item preperation instruction.
269
279
*
270
280
* This method will return <b>FALSE</b> if the list has not yet been filled.
281
+ *
271
282
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
272
- * @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
283
+ *
284
+ * @return string|bool single value, or <b>FALSE</b> if Non-numeric index
273
285
*/
274
286
public function getAsin ($ i = 0 )
275
287
{
@@ -285,8 +297,10 @@ public function getAsin($i = 0)
285
297
*
286
298
* Possible values are "RequiresFNSKULabel" and "CanUseOriginalBarcode".
287
299
* This method will return <b>FALSE</b> if the list has not yet been filled.
300
+ *
288
301
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
289
- * @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
302
+ *
303
+ * @return string|bool single value, or <b>FALSE</b> if Non-numeric index
290
304
*/
291
305
public function getBarcodeInstruction ($ i = 0 )
292
306
{
@@ -303,8 +317,10 @@ public function getBarcodeInstruction($i = 0)
303
317
* Possible values are "ConsultHelpDocuments", "NoAdditionalPrepRequired",
304
318
* and "SeePrepInstructionsList".
305
319
* This method will return <b>FALSE</b> if the list has not yet been filled.
320
+ *
306
321
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
307
- * @return string|boolean single value, or <b>FALSE</b> if Non-numeric index
322
+ *
323
+ * @return string|bool single value, or <b>FALSE</b> if Non-numeric index
308
324
*/
309
325
public function getPrepGuidance ($ i = 0 )
310
326
{
@@ -321,8 +337,10 @@ public function getPrepGuidance($i = 0)
321
337
* Possible values are "Polybagging", "BubbleWrapping", "Taping", "BlackShrinkWrapping",
322
338
* "Labeling", and "HangGarment".
323
339
* This method will return <b>FALSE</b> if the list has not yet been filled.
340
+ *
324
341
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
325
- * @return array|boolean simple array, or <b>FALSE</b> if Non-numeric index
342
+ *
343
+ * @return array|bool simple array, or <b>FALSE</b> if Non-numeric index
326
344
*/
327
345
public function getPrepInstructions ($ i = 0 )
328
346
{
@@ -348,8 +366,11 @@ public function getPrepInstructions($i = 0)
348
366
* Prep instructions will only include this data if SKUs were sent when
349
367
* retrieving the list of prep instructions.
350
368
* This method will return <b>FALSE</b> if the list has not yet been filled.
369
+ *
351
370
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
352
- * @return array|boolean multi-dimensional array, or <b>FALSE</b> if Non-numeric index
371
+ *
372
+ * @return array|bool multi-dimensional array, or <b>FALSE</b> if Non-numeric index
373
+ *
353
374
* @see getPrepInstructions
354
375
*/
355
376
public function getAmazonPrepFees ($ i = 0 )
@@ -374,8 +395,11 @@ public function getAmazonPrepFees($i = 0)
374
395
* <li><b>PrepInstructionList</b> (see <i>getPrepInstructions</i> for details)</li>
375
396
* <li><b>AmazonPrepFees</b> (see <i>getAmazonPrepFees</i> for details)</li>
376
397
* </ul>
398
+ *
377
399
* @param int $i [optional] <p>List index of the instruction to return. Defaults to NULL.</p>
378
- * @return array|boolean multi-dimensional array, or <b>FALSE</b> if list not filled yet
400
+ *
401
+ * @return array|bool multi-dimensional array, or <b>FALSE</b> if list not filled yet
402
+ *
379
403
* @see getPrepInstructionList
380
404
* @see getAmazonPrepFees
381
405
*/
@@ -400,8 +424,10 @@ public function getPrepList($i = null)
400
424
* <li><b>SellerSKU</b> or <b>ASIN</b></li>
401
425
* <li><b>ErrorReason</b></li>
402
426
* </ul>
427
+ *
403
428
* @param int $i [optional] <p>List index of the item to return. Defaults to NULL.</p>
404
- * @return array|boolean multi-dimensional array, or <b>FALSE</b> if list not filled yet
429
+ *
430
+ * @return array|bool multi-dimensional array, or <b>FALSE</b> if list not filled yet
405
431
*/
406
432
public function getInvalidItemList ($ i = null )
407
433
{
@@ -416,7 +442,8 @@ public function getInvalidItemList($i = null)
416
442
}
417
443
418
444
/**
419
- * Iterator function
445
+ * Iterator function.
446
+ *
420
447
* @return array
421
448
*/
422
449
public function current ()
@@ -425,15 +452,16 @@ public function current()
425
452
}
426
453
427
454
/**
428
- * Iterator function
455
+ * Iterator function.
429
456
*/
430
457
public function rewind ()
431
458
{
432
459
$ this ->i = 0 ;
433
460
}
434
461
435
462
/**
436
- * Iterator function
463
+ * Iterator function.
464
+ *
437
465
* @return int
438
466
*/
439
467
public function key ()
@@ -442,16 +470,17 @@ public function key()
442
470
}
443
471
444
472
/**
445
- * Iterator function
473
+ * Iterator function.
446
474
*/
447
475
public function next ()
448
476
{
449
477
$ this ->i ++;
450
478
}
451
479
452
480
/**
453
- * Iterator function
454
- * @return boolean
481
+ * Iterator function.
482
+ *
483
+ * @return bool
455
484
*/
456
485
public function valid ()
457
486
{
0 commit comments