| 1 |
lars |
1 |
<?php
|
|
|
2 |
/*******************************************************************************
|
|
|
3 |
* Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
*
|
|
|
6 |
* You may not use this file except in compliance with the License.
|
|
|
7 |
* You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
|
|
|
8 |
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
9 |
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
|
10 |
* specific language governing permissions and limitations under the License.
|
|
|
11 |
* *****************************************************************************
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* @see CheckoutByAmazon_Service_Model
|
|
|
17 |
*/
|
|
|
18 |
require_once ('CheckoutByAmazon/Service/Model.php');
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
/**
|
|
|
23 |
* CheckoutByAmazon_Service_Model_PurchaseItem
|
|
|
24 |
*
|
|
|
25 |
* Properties:
|
|
|
26 |
* <ul>
|
|
|
27 |
*
|
|
|
28 |
* <li>MerchantItemId: IdType</li>
|
|
|
29 |
* <li>SKU: string</li>
|
|
|
30 |
* <li>MerchantId: IdType</li>
|
|
|
31 |
* <li>Title: string</li>
|
|
|
32 |
* <li>Description: string</li>
|
|
|
33 |
* <li>UnitPrice: CheckoutByAmazon_Service_Model_Price</li>
|
|
|
34 |
* <li>Quantity: PositiveInteger</li>
|
|
|
35 |
* <li>URL: string</li>
|
|
|
36 |
* <li>Category: string</li>
|
|
|
37 |
* <li>FulfillmentNetwork: FulfillmentNetwork</li>
|
|
|
38 |
* <li>ItemCustomData: string</li>
|
|
|
39 |
* <li>ProductType: ProductType</li>
|
|
|
40 |
* <li>PhysicalProductAttributes: CheckoutByAmazon_Service_Model_PhysicalProductAttributes</li>
|
|
|
41 |
* <li>DigitalProductAttributes: CheckoutByAmazon_Service_Model_DigitalProductAttributes</li>
|
|
|
42 |
*
|
|
|
43 |
* </ul>
|
|
|
44 |
*/
|
|
|
45 |
class CheckoutByAmazon_Service_Model_PurchaseItem extends CheckoutByAmazon_Service_Model
|
|
|
46 |
{
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* Construct new CheckoutByAmazon_Service_Model_PurchaseItem
|
|
|
51 |
*
|
|
|
52 |
* @param mixed $data DOMElement or Associative Array to construct from.
|
|
|
53 |
*
|
|
|
54 |
* Valid properties:
|
|
|
55 |
* <ul>
|
|
|
56 |
*
|
|
|
57 |
* <li>MerchantItemId: IdType</li>
|
|
|
58 |
* <li>SKU: string</li>
|
|
|
59 |
* <li>MerchantId: IdType</li>
|
|
|
60 |
* <li>Title: string</li>
|
|
|
61 |
* <li>Description: string</li>
|
|
|
62 |
* <li>UnitPrice: CheckoutByAmazon_Service_Model_Price</li>
|
|
|
63 |
* <li>Quantity: PositiveInteger</li>
|
|
|
64 |
* <li>URL: string</li>
|
|
|
65 |
* <li>Category: string</li>
|
|
|
66 |
* <li>FulfillmentNetwork: FulfillmentNetwork</li>
|
|
|
67 |
* <li>ItemCustomData: string</li>
|
|
|
68 |
* <li>ProductType: ProductType</li>
|
|
|
69 |
* <li>PhysicalProductAttributes: CheckoutByAmazon_Service_Model_PhysicalProductAttributes</li>
|
|
|
70 |
* <li>DigitalProductAttributes: CheckoutByAmazon_Service_Model_DigitalProductAttributes</li>
|
|
|
71 |
*
|
|
|
72 |
* </ul>
|
|
|
73 |
*/
|
|
|
74 |
public function __construct($data = null)
|
|
|
75 |
{
|
|
|
76 |
$this->_fields = array (
|
|
|
77 |
'MerchantItemId' => array('FieldValue' => null, 'FieldType' => 'IdType'),
|
|
|
78 |
'SKU' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
79 |
'MerchantId' => array('FieldValue' => null, 'FieldType' => 'IdType'),
|
|
|
80 |
'Title' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
81 |
'Description' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
82 |
'UnitPrice' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_Price'),
|
|
|
83 |
'Quantity' => array('FieldValue' => null, 'FieldType' => 'PositiveInteger'),
|
|
|
84 |
'URL' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
85 |
'Category' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
86 |
'FulfillmentNetwork' => array('FieldValue' => null, 'FieldType' => 'FulfillmentNetwork'),
|
|
|
87 |
'ItemCustomData' => array('FieldValue' => null, 'FieldType' => 'string'),
|
|
|
88 |
'ProductType' => array('FieldValue' => null, 'FieldType' => 'ProductType'),
|
|
|
89 |
'PhysicalProductAttributes' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_PhysicalProductAttributes'),
|
|
|
90 |
'DigitalProductAttributes' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_DigitalProductAttributes'),
|
|
|
91 |
);
|
|
|
92 |
parent::__construct($data);
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
/**
|
|
|
96 |
* Gets the value of the MerchantItemId property.
|
|
|
97 |
*
|
|
|
98 |
* @return IdType MerchantItemId
|
|
|
99 |
*/
|
|
|
100 |
public function getMerchantItemId()
|
|
|
101 |
{
|
|
|
102 |
return $this->_fields['MerchantItemId']['FieldValue'];
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
/**
|
|
|
106 |
* Sets the value of the MerchantItemId property.
|
|
|
107 |
*
|
|
|
108 |
* @param IdType MerchantItemId
|
|
|
109 |
* @return this instance
|
|
|
110 |
*/
|
|
|
111 |
public function setMerchantItemId($value)
|
|
|
112 |
{
|
|
|
113 |
$this->_fields['MerchantItemId']['FieldValue'] = $value;
|
|
|
114 |
return $this;
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
/**
|
|
|
119 |
* Checks if MerchantItemId is set
|
|
|
120 |
*
|
|
|
121 |
* @return bool true if MerchantItemId is set
|
|
|
122 |
*/
|
|
|
123 |
public function isSetMerchantItemId()
|
|
|
124 |
{
|
|
|
125 |
return !is_null($this->_fields['MerchantItemId']['FieldValue']);
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
/**
|
|
|
129 |
* Gets the value of the SKU property.
|
|
|
130 |
*
|
|
|
131 |
* @return string SKU
|
|
|
132 |
*/
|
|
|
133 |
public function getSKU()
|
|
|
134 |
{
|
|
|
135 |
return $this->_fields['SKU']['FieldValue'];
|
|
|
136 |
}
|
|
|
137 |
|
|
|
138 |
/**
|
|
|
139 |
* Sets the value of the SKU property.
|
|
|
140 |
*
|
|
|
141 |
* @param string SKU
|
|
|
142 |
* @return this instance
|
|
|
143 |
*/
|
|
|
144 |
public function setSKU($value)
|
|
|
145 |
{
|
|
|
146 |
$this->_fields['SKU']['FieldValue'] = $value;
|
|
|
147 |
return $this;
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
|
|
|
152 |
/**
|
|
|
153 |
* Checks if SKU is set
|
|
|
154 |
*
|
|
|
155 |
* @return bool true if SKU is set
|
|
|
156 |
*/
|
|
|
157 |
public function isSetSKU()
|
|
|
158 |
{
|
|
|
159 |
return !is_null($this->_fields['SKU']['FieldValue']);
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
/**
|
|
|
163 |
* Gets the value of the MerchantId property.
|
|
|
164 |
*
|
|
|
165 |
* @return IdType MerchantId
|
|
|
166 |
*/
|
|
|
167 |
public function getMerchantId()
|
|
|
168 |
{
|
|
|
169 |
return $this->_fields['MerchantId']['FieldValue'];
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
/**
|
|
|
173 |
* Sets the value of the MerchantId property.
|
|
|
174 |
*
|
|
|
175 |
* @param IdType MerchantId
|
|
|
176 |
* @return this instance
|
|
|
177 |
*/
|
|
|
178 |
public function setMerchantId($value)
|
|
|
179 |
{
|
|
|
180 |
$this->_fields['MerchantId']['FieldValue'] = $value;
|
|
|
181 |
return $this;
|
|
|
182 |
}
|
|
|
183 |
|
|
|
184 |
|
|
|
185 |
/**
|
|
|
186 |
* Checks if MerchantId is set
|
|
|
187 |
*
|
|
|
188 |
* @return bool true if MerchantId is set
|
|
|
189 |
*/
|
|
|
190 |
public function isSetMerchantId()
|
|
|
191 |
{
|
|
|
192 |
return !is_null($this->_fields['MerchantId']['FieldValue']);
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
/**
|
|
|
196 |
* Gets the value of the Title property.
|
|
|
197 |
*
|
|
|
198 |
* @return string Title
|
|
|
199 |
*/
|
|
|
200 |
public function getTitle()
|
|
|
201 |
{
|
|
|
202 |
return $this->_fields['Title']['FieldValue'];
|
|
|
203 |
}
|
|
|
204 |
|
|
|
205 |
/**
|
|
|
206 |
* Sets the value of the Title property.
|
|
|
207 |
*
|
|
|
208 |
* @param string Title
|
|
|
209 |
* @return this instance
|
|
|
210 |
*/
|
|
|
211 |
public function setTitle($value)
|
|
|
212 |
{
|
|
|
213 |
$this->_fields['Title']['FieldValue'] = $value;
|
|
|
214 |
return $this;
|
|
|
215 |
}
|
|
|
216 |
|
|
|
217 |
|
|
|
218 |
/**
|
|
|
219 |
* Checks if Title is set
|
|
|
220 |
*
|
|
|
221 |
* @return bool true if Title is set
|
|
|
222 |
*/
|
|
|
223 |
public function isSetTitle()
|
|
|
224 |
{
|
|
|
225 |
return !is_null($this->_fields['Title']['FieldValue']);
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
/**
|
|
|
229 |
* Gets the value of the Description property.
|
|
|
230 |
*
|
|
|
231 |
* @return string Description
|
|
|
232 |
*/
|
|
|
233 |
public function getDescription()
|
|
|
234 |
{
|
|
|
235 |
return $this->_fields['Description']['FieldValue'];
|
|
|
236 |
}
|
|
|
237 |
|
|
|
238 |
/**
|
|
|
239 |
* Sets the value of the Description property.
|
|
|
240 |
*
|
|
|
241 |
* @param string Description
|
|
|
242 |
* @return this instance
|
|
|
243 |
*/
|
|
|
244 |
public function setDescription($value)
|
|
|
245 |
{
|
|
|
246 |
$this->_fields['Description']['FieldValue'] = $value;
|
|
|
247 |
return $this;
|
|
|
248 |
}
|
|
|
249 |
|
|
|
250 |
|
|
|
251 |
/**
|
|
|
252 |
* Checks if Description is set
|
|
|
253 |
*
|
|
|
254 |
* @return bool true if Description is set
|
|
|
255 |
*/
|
|
|
256 |
public function isSetDescription()
|
|
|
257 |
{
|
|
|
258 |
return !is_null($this->_fields['Description']['FieldValue']);
|
|
|
259 |
}
|
|
|
260 |
|
|
|
261 |
/**
|
|
|
262 |
* Gets the value of the UnitPrice.
|
|
|
263 |
*
|
|
|
264 |
* @return Price UnitPrice
|
|
|
265 |
*/
|
|
|
266 |
public function getUnitPrice()
|
|
|
267 |
{
|
|
|
268 |
return $this->_fields['UnitPrice']['FieldValue'];
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
/**
|
|
|
272 |
* Sets the value of the UnitPrice.
|
|
|
273 |
*
|
|
|
274 |
* @param Price UnitPrice
|
|
|
275 |
* @return void
|
|
|
276 |
*/
|
|
|
277 |
public function setUnitPrice($value)
|
|
|
278 |
{
|
|
|
279 |
$this->_fields['UnitPrice']['FieldValue'] = $value;
|
|
|
280 |
return;
|
|
|
281 |
}
|
|
|
282 |
|
|
|
283 |
|
|
|
284 |
/**
|
|
|
285 |
* Checks if UnitPrice is set
|
|
|
286 |
*
|
|
|
287 |
* @return bool true if UnitPrice property is set
|
|
|
288 |
*/
|
|
|
289 |
public function isSetUnitPrice()
|
|
|
290 |
{
|
|
|
291 |
return !is_null($this->_fields['UnitPrice']['FieldValue']);
|
|
|
292 |
|
|
|
293 |
}
|
|
|
294 |
|
|
|
295 |
/**
|
|
|
296 |
* Gets the value of the Quantity property.
|
|
|
297 |
*
|
|
|
298 |
* @return PositiveInteger Quantity
|
|
|
299 |
*/
|
|
|
300 |
public function getQuantity()
|
|
|
301 |
{
|
|
|
302 |
return $this->_fields['Quantity']['FieldValue'];
|
|
|
303 |
}
|
|
|
304 |
|
|
|
305 |
/**
|
|
|
306 |
* Sets the value of the Quantity property.
|
|
|
307 |
*
|
|
|
308 |
* @param PositiveInteger Quantity
|
|
|
309 |
* @return this instance
|
|
|
310 |
*/
|
|
|
311 |
public function setQuantity($value)
|
|
|
312 |
{
|
|
|
313 |
$this->_fields['Quantity']['FieldValue'] = $value;
|
|
|
314 |
return $this;
|
|
|
315 |
}
|
|
|
316 |
|
|
|
317 |
|
|
|
318 |
/**
|
|
|
319 |
* Checks if Quantity is set
|
|
|
320 |
*
|
|
|
321 |
* @return bool true if Quantity is set
|
|
|
322 |
*/
|
|
|
323 |
public function isSetQuantity()
|
|
|
324 |
{
|
|
|
325 |
return !is_null($this->_fields['Quantity']['FieldValue']);
|
|
|
326 |
}
|
|
|
327 |
|
|
|
328 |
/**
|
|
|
329 |
* Gets the value of the URL property.
|
|
|
330 |
*
|
|
|
331 |
* @return string URL
|
|
|
332 |
*/
|
|
|
333 |
public function getURL()
|
|
|
334 |
{
|
|
|
335 |
return $this->_fields['URL']['FieldValue'];
|
|
|
336 |
}
|
|
|
337 |
|
|
|
338 |
/**
|
|
|
339 |
* Sets the value of the URL property.
|
|
|
340 |
*
|
|
|
341 |
* @param string URL
|
|
|
342 |
* @return this instance
|
|
|
343 |
*/
|
|
|
344 |
public function setURL($value)
|
|
|
345 |
{
|
|
|
346 |
$this->_fields['URL']['FieldValue'] = $value;
|
|
|
347 |
return $this;
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
|
|
|
351 |
/**
|
|
|
352 |
* Checks if URL is set
|
|
|
353 |
*
|
|
|
354 |
* @return bool true if URL is set
|
|
|
355 |
*/
|
|
|
356 |
public function isSetURL()
|
|
|
357 |
{
|
|
|
358 |
return !is_null($this->_fields['URL']['FieldValue']);
|
|
|
359 |
}
|
|
|
360 |
|
|
|
361 |
/**
|
|
|
362 |
* Gets the value of the Category property.
|
|
|
363 |
*
|
|
|
364 |
* @return string Category
|
|
|
365 |
*/
|
|
|
366 |
public function getCategory()
|
|
|
367 |
{
|
|
|
368 |
return $this->_fields['Category']['FieldValue'];
|
|
|
369 |
}
|
|
|
370 |
|
|
|
371 |
/**
|
|
|
372 |
* Sets the value of the Category property.
|
|
|
373 |
*
|
|
|
374 |
* @param string Category
|
|
|
375 |
* @return this instance
|
|
|
376 |
*/
|
|
|
377 |
public function setCategory($value)
|
|
|
378 |
{
|
|
|
379 |
$this->_fields['Category']['FieldValue'] = $value;
|
|
|
380 |
return $this;
|
|
|
381 |
}
|
|
|
382 |
|
|
|
383 |
|
|
|
384 |
/**
|
|
|
385 |
* Checks if Category is set
|
|
|
386 |
*
|
|
|
387 |
* @return bool true if Category is set
|
|
|
388 |
*/
|
|
|
389 |
public function isSetCategory()
|
|
|
390 |
{
|
|
|
391 |
return !is_null($this->_fields['Category']['FieldValue']);
|
|
|
392 |
}
|
|
|
393 |
|
|
|
394 |
/**
|
|
|
395 |
* Gets the value of the FulfillmentNetwork property.
|
|
|
396 |
*
|
|
|
397 |
* @return FulfillmentNetwork FulfillmentNetwork
|
|
|
398 |
*/
|
|
|
399 |
public function getFulfillmentNetwork()
|
|
|
400 |
{
|
|
|
401 |
return $this->_fields['FulfillmentNetwork']['FieldValue'];
|
|
|
402 |
}
|
|
|
403 |
|
|
|
404 |
/**
|
|
|
405 |
* Sets the value of the FulfillmentNetwork property.
|
|
|
406 |
*
|
|
|
407 |
* @param FulfillmentNetwork FulfillmentNetwork
|
|
|
408 |
* @return this instance
|
|
|
409 |
*/
|
|
|
410 |
public function setFulfillmentNetwork($value)
|
|
|
411 |
{
|
|
|
412 |
$this->_fields['FulfillmentNetwork']['FieldValue'] = $value;
|
|
|
413 |
return $this;
|
|
|
414 |
}
|
|
|
415 |
|
|
|
416 |
|
|
|
417 |
/**
|
|
|
418 |
* Checks if FulfillmentNetwork is set
|
|
|
419 |
*
|
|
|
420 |
* @return bool true if FulfillmentNetwork is set
|
|
|
421 |
*/
|
|
|
422 |
public function isSetFulfillmentNetwork()
|
|
|
423 |
{
|
|
|
424 |
return !is_null($this->_fields['FulfillmentNetwork']['FieldValue']);
|
|
|
425 |
}
|
|
|
426 |
|
|
|
427 |
/**
|
|
|
428 |
* Gets the value of the ItemCustomData property.
|
|
|
429 |
*
|
|
|
430 |
* @return string ItemCustomData
|
|
|
431 |
*/
|
|
|
432 |
public function getItemCustomData()
|
|
|
433 |
{
|
|
|
434 |
return $this->_fields['ItemCustomData']['FieldValue'];
|
|
|
435 |
}
|
|
|
436 |
|
|
|
437 |
/**
|
|
|
438 |
* Sets the value of the ItemCustomData property.
|
|
|
439 |
*
|
|
|
440 |
* @param string ItemCustomData
|
|
|
441 |
* @return this instance
|
|
|
442 |
*/
|
|
|
443 |
public function setItemCustomData($value)
|
|
|
444 |
{
|
|
|
445 |
$this->_fields['ItemCustomData']['FieldValue'] = $value;
|
|
|
446 |
return $this;
|
|
|
447 |
}
|
|
|
448 |
|
|
|
449 |
|
|
|
450 |
/**
|
|
|
451 |
* Checks if ItemCustomData is set
|
|
|
452 |
*
|
|
|
453 |
* @return bool true if ItemCustomData is set
|
|
|
454 |
*/
|
|
|
455 |
public function isSetItemCustomData()
|
|
|
456 |
{
|
|
|
457 |
return !is_null($this->_fields['ItemCustomData']['FieldValue']);
|
|
|
458 |
}
|
|
|
459 |
|
|
|
460 |
/**
|
|
|
461 |
* Gets the value of the ProductType property.
|
|
|
462 |
*
|
|
|
463 |
* @return ProductType ProductType
|
|
|
464 |
*/
|
|
|
465 |
public function getProductType()
|
|
|
466 |
{
|
|
|
467 |
return $this->_fields['ProductType']['FieldValue'];
|
|
|
468 |
}
|
|
|
469 |
|
|
|
470 |
/**
|
|
|
471 |
* Sets the value of the ProductType property.
|
|
|
472 |
*
|
|
|
473 |
* @param ProductType ProductType
|
|
|
474 |
* @return this instance
|
|
|
475 |
*/
|
|
|
476 |
public function setProductType($value)
|
|
|
477 |
{
|
|
|
478 |
$this->_fields['ProductType']['FieldValue'] = $value;
|
|
|
479 |
return $this;
|
|
|
480 |
}
|
|
|
481 |
|
|
|
482 |
|
|
|
483 |
/**
|
|
|
484 |
* Checks if ProductType is set
|
|
|
485 |
*
|
|
|
486 |
* @return bool true if ProductType is set
|
|
|
487 |
*/
|
|
|
488 |
public function isSetProductType()
|
|
|
489 |
{
|
|
|
490 |
return !is_null($this->_fields['ProductType']['FieldValue']);
|
|
|
491 |
}
|
|
|
492 |
|
|
|
493 |
/**
|
|
|
494 |
* Gets the value of the PhysicalProductAttributes.
|
|
|
495 |
*
|
|
|
496 |
* @return PhysicalProductAttributes PhysicalProductAttributes
|
|
|
497 |
*/
|
|
|
498 |
public function getPhysicalProductAttributes()
|
|
|
499 |
{
|
|
|
500 |
return $this->_fields['PhysicalProductAttributes']['FieldValue'];
|
|
|
501 |
}
|
|
|
502 |
|
|
|
503 |
/**
|
|
|
504 |
* Sets the value of the PhysicalProductAttributes.
|
|
|
505 |
*
|
|
|
506 |
* @param PhysicalProductAttributes PhysicalProductAttributes
|
|
|
507 |
* @return void
|
|
|
508 |
*/
|
|
|
509 |
public function setPhysicalProductAttributes($value)
|
|
|
510 |
{
|
|
|
511 |
$this->_fields['PhysicalProductAttributes']['FieldValue'] = $value;
|
|
|
512 |
return;
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
|
|
|
516 |
/**
|
|
|
517 |
* Checks if PhysicalProductAttributes is set
|
|
|
518 |
*
|
|
|
519 |
* @return bool true if PhysicalProductAttributes property is set
|
|
|
520 |
*/
|
|
|
521 |
public function isSetPhysicalProductAttributes()
|
|
|
522 |
{
|
|
|
523 |
return !is_null($this->_fields['PhysicalProductAttributes']['FieldValue']);
|
|
|
524 |
|
|
|
525 |
}
|
|
|
526 |
|
|
|
527 |
/**
|
|
|
528 |
* Gets the value of the DigitalProductAttributes.
|
|
|
529 |
*
|
|
|
530 |
* @return DigitalProductAttributes DigitalProductAttributes
|
|
|
531 |
*/
|
|
|
532 |
public function getDigitalProductAttributes()
|
|
|
533 |
{
|
|
|
534 |
return $this->_fields['DigitalProductAttributes']['FieldValue'];
|
|
|
535 |
}
|
|
|
536 |
|
|
|
537 |
/**
|
|
|
538 |
* Sets the value of the DigitalProductAttributes.
|
|
|
539 |
*
|
|
|
540 |
* @param DigitalProductAttributes DigitalProductAttributes
|
|
|
541 |
* @return void
|
|
|
542 |
*/
|
|
|
543 |
public function setDigitalProductAttributes($value)
|
|
|
544 |
{
|
|
|
545 |
$this->_fields['DigitalProductAttributes']['FieldValue'] = $value;
|
|
|
546 |
return;
|
|
|
547 |
}
|
|
|
548 |
|
|
|
549 |
|
|
|
550 |
/**
|
|
|
551 |
* Checks if DigitalProductAttributes is set
|
|
|
552 |
*
|
|
|
553 |
* @return bool true if DigitalProductAttributes property is set
|
|
|
554 |
*/
|
|
|
555 |
public function isSetDigitalProductAttributes()
|
|
|
556 |
{
|
|
|
557 |
return !is_null($this->_fields['DigitalProductAttributes']['FieldValue']);
|
|
|
558 |
|
|
|
559 |
}
|
|
|
560 |
/**
|
|
|
561 |
* Creates an Item
|
|
|
562 |
*
|
|
|
563 |
* @param MerchantItemId,Title,UnitPriceAmount
|
|
|
564 |
* @return instance
|
|
|
565 |
*/
|
|
|
566 |
public function createItem($merchantItemId,$title,$unitPriceAmount)
|
|
|
567 |
{
|
|
|
568 |
$this->setMerchantId( CheckoutByAmazon_Service_MerchantValues::getInstance()->getMerchantId());
|
|
|
569 |
$this->setTitle($title);
|
|
|
570 |
$this->setMerchantItemId($merchantItemId);
|
|
|
571 |
$this->setUnitPrice(new CheckoutByAmazon_Service_Model_Price(array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(), 'Amount' => $unitPriceAmount)));
|
|
|
572 |
return $this;
|
|
|
573 |
}
|
|
|
574 |
/**
|
|
|
575 |
* Creates an Physical Item
|
|
|
576 |
*
|
|
|
577 |
* @param Item item,Delivery Method Service Level
|
|
|
578 |
* @return instance
|
|
|
579 |
*/
|
|
|
580 |
public function createPhysicalItem($merchantItemId,$title,$unitPriceAmount,$deliveryMethod)
|
|
|
581 |
{
|
|
|
582 |
$Item = $this->createItem($merchantItemId,$title,$unitPriceAmount);
|
|
|
583 |
$deliveryObject = new CheckoutByAmazon_Service_Model_DeliveryMethod();
|
|
|
584 |
$deliveryObject->setServiceLevel($deliveryMethod);
|
|
|
585 |
$physicalAttrObject = new CheckoutByAmazon_Service_Model_PhysicalProductAttributes();
|
|
|
586 |
$physicalAttrObject->setDeliveryMethod($deliveryObject);
|
|
|
587 |
$Item->setPhysicalProductAttributes($physicalAttrObject);
|
|
|
588 |
return $Item;
|
|
|
589 |
}
|
|
|
590 |
|
|
|
591 |
/**
|
|
|
592 |
* Sets a custom shipping Label
|
|
|
593 |
*
|
|
|
594 |
* @param Label
|
|
|
595 |
* @return instance
|
|
|
596 |
*/
|
|
|
597 |
public function setShippingLabel($label)
|
|
|
598 |
{
|
|
|
599 |
$this->getPhysicalProductAttributes()->getDeliveryMethod()->setDisplayableShippingLabel($label);
|
|
|
600 |
return $this;
|
|
|
601 |
}
|
|
|
602 |
|
|
|
603 |
/**
|
|
|
604 |
* Sets a Destination Name
|
|
|
605 |
*
|
|
|
606 |
* @param DestinationName
|
|
|
607 |
* @return instance
|
|
|
608 |
*/
|
|
|
609 |
public function setDestinationName($destinationName)
|
|
|
610 |
{
|
|
|
611 |
$this->getPhysicalProductAttributes()->getDeliveryMethod()->setDestinationName($destinationName);
|
|
|
612 |
return $this;
|
|
|
613 |
}
|
|
|
614 |
|
|
|
615 |
/**
|
|
|
616 |
* Sets Shipping Custom Data
|
|
|
617 |
*
|
|
|
618 |
* @param ShippingCustomData
|
|
|
619 |
* @return instance
|
|
|
620 |
*/
|
|
|
621 |
public function setShippingCustomData($shippingCustomData)
|
|
|
622 |
{
|
|
|
623 |
$this->getPhysicalProductAttributes()->getDeliveryMethod()->setShippingCustomData($shippingCustomData);
|
|
|
624 |
return $this;
|
|
|
625 |
}
|
|
|
626 |
|
|
|
627 |
/**
|
|
|
628 |
* Sets Item tax
|
|
|
629 |
*
|
|
|
630 |
* @param TaxAmount
|
|
|
631 |
* @return instance
|
|
|
632 |
*/
|
|
|
633 |
public function setItemTax($taxAmount)
|
|
|
634 |
{
|
|
|
635 |
if($this->isSetPhysicalProductAttributes())
|
|
|
636 |
{
|
|
|
637 |
if($this->getPhysicalProductAttributes()->isSetItemCharges())
|
|
|
638 |
{
|
|
|
639 |
$this->getPhysicalProductAttributes()->getItemCharges()->setTax(new
|
|
|
640 |
CheckoutByAmazon_Service_Model_Price(array
|
|
|
641 |
('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(), 'Amount' => $taxAmount)));
|
|
|
642 |
}
|
|
|
643 |
else
|
|
|
644 |
{
|
|
|
645 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
646 |
$chargesObject->setTax(new CheckoutByAmazon_Service_Model_Price(
|
|
|
647 |
array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(),
|
|
|
648 |
'Amount' => $taxAmount)));
|
|
|
649 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
650 |
}
|
|
|
651 |
}
|
|
|
652 |
else
|
|
|
653 |
{
|
|
|
654 |
$physicalAttribsObj = new CheckoutByAmazon_Service_Model_PhysicalProductAttributes();
|
|
|
655 |
$this->setPhysicalProductAttributes($physicalAttribsObj);
|
|
|
656 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
657 |
$chargesObject->setTax(new CheckoutByAmazon_Service_Model_Price(
|
|
|
658 |
array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(),
|
|
|
659 |
'Amount' => $taxAmount)));
|
|
|
660 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
661 |
|
|
|
662 |
}
|
|
|
663 |
return $this;
|
|
|
664 |
}
|
|
|
665 |
|
|
|
666 |
/**
|
|
|
667 |
* Sets Shipping Charges
|
|
|
668 |
*
|
|
|
669 |
* @param ShippingAmount
|
|
|
670 |
* @return instance
|
|
|
671 |
*/
|
|
|
672 |
public function setItemShippingCharges($shippingAmount)
|
|
|
673 |
{
|
|
|
674 |
if($this->isSetPhysicalProductAttributes())
|
|
|
675 |
{
|
|
|
676 |
|
|
|
677 |
if($this->getPhysicalProductAttributes()->isSetItemCharges())
|
|
|
678 |
{
|
|
|
679 |
$this->getPhysicalProductAttributes()->getItemCharges()->setShipping(new
|
|
|
680 |
CheckoutByAmazon_Service_Model_Price(array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(),
|
|
|
681 |
'Amount' => $shippingAmount)));
|
|
|
682 |
}
|
|
|
683 |
else
|
|
|
684 |
{
|
|
|
685 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
686 |
$chargesObject->setShipping(new CheckoutByAmazon_Service_Model_Price(
|
|
|
687 |
array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(),
|
|
|
688 |
'Amount' => $shippingAmount)));
|
|
|
689 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
690 |
}
|
|
|
691 |
}
|
|
|
692 |
else
|
|
|
693 |
{
|
|
|
694 |
$physicalAttribsObj = new CheckoutByAmazon_Service_Model_PhysicalProductAttributes();
|
|
|
695 |
$this->setPhysicalProductAttributes($physicalAttribsObj);
|
|
|
696 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
697 |
$chargesObject->setShipping(new CheckoutByAmazon_Service_Model_Price(
|
|
|
698 |
array('CurrencyCode' => CheckoutByAmazon_Service_MerchantValues::getInstance()->getCurrencyCode(),
|
|
|
699 |
'Amount' => $shippingAmount)));
|
|
|
700 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
701 |
|
|
|
702 |
}
|
|
|
703 |
|
|
|
704 |
return $this;
|
|
|
705 |
}
|
|
|
706 |
|
|
|
707 |
/**
|
|
|
708 |
* Sets Item Promotions
|
|
|
709 |
*
|
|
|
710 |
* @param Promotion Promotion
|
|
|
711 |
* @return instance
|
|
|
712 |
*/
|
|
|
713 |
public function setItemPromotions($promotion)
|
|
|
714 |
{
|
|
|
715 |
if($this->isSetPhysicalProductAttributes())
|
|
|
716 |
{
|
|
|
717 |
|
|
|
718 |
if($this->getPhysicalProductAttributes()->isSetItemCharges())
|
|
|
719 |
{
|
|
|
720 |
$this->getPhysicalProductAttributes()->getItemCharges()->setPromotions($promotion);
|
|
|
721 |
}
|
|
|
722 |
else
|
|
|
723 |
{
|
|
|
724 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
725 |
$chargesObject->setPromotions($promotion);
|
|
|
726 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
727 |
}
|
|
|
728 |
}
|
|
|
729 |
else
|
|
|
730 |
{
|
|
|
731 |
$physicalAttribsObj = new CheckoutByAmazon_Service_Model_PhysicalProductAttributes();
|
|
|
732 |
$this->setPhysicalProductAttributes($physicalAttribsObj);
|
|
|
733 |
$chargesObject = new CheckoutByAmazon_Service_Model_Charges();
|
|
|
734 |
$chargesObject->setPromotions($promotion);
|
|
|
735 |
$this->getPhysicalProductAttributes()->setItemCharges($chargesObject);
|
|
|
736 |
|
|
|
737 |
}
|
|
|
738 |
return $this;
|
|
|
739 |
}
|
|
|
740 |
/**
|
|
|
741 |
* Sets Item Weight
|
|
|
742 |
*
|
|
|
743 |
* @param WeightValue
|
|
|
744 |
* @return instance
|
|
|
745 |
*/
|
|
|
746 |
public function setWeight($weightValue)
|
|
|
747 |
{
|
|
|
748 |
$weightObject = new CheckoutByAmazon_Service_Model_Weight();
|
|
|
749 |
$weightObject->setValue($weightValue);
|
|
|
750 |
$weightObject->setUnit(CheckoutByAmazon_Service_MerchantValues::getInstance()->getWeightUnit());
|
|
|
751 |
$this->getPhysicalProductAttributes()->setWeight($weightObject);
|
|
|
752 |
return $this;
|
|
|
753 |
}
|
|
|
754 |
|
|
|
755 |
/**
|
|
|
756 |
* Sets Condition
|
|
|
757 |
*
|
|
|
758 |
* @param Condition
|
|
|
759 |
* @return instance
|
|
|
760 |
*/
|
|
|
761 |
public function setCondition($condition)
|
|
|
762 |
{
|
|
|
763 |
$this->getPhysicalProductAttributes()->setCondition($condition);
|
|
|
764 |
return $this;
|
|
|
765 |
}
|
|
|
766 |
|
|
|
767 |
}
|
|
|
768 |
?>
|