|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Slince\Shopify\Manager\DraftOrder; |
|
4
|
|
|
|
|
5
|
|
|
use Slince\Shopify\Common\Model\AdminGraphqlApiId; |
|
6
|
|
|
use Slince\Shopify\Common\Model\Model; |
|
7
|
|
|
use Slince\Shopify\Manager\Customer\Customer; |
|
8
|
|
|
use Slince\Shopify\Manager\Order\Address; |
|
9
|
|
|
use Slince\Shopify\Manager\Order\LineItem; |
|
10
|
|
|
use Slince\Shopify\Manager\Order\TaxLine; |
|
11
|
|
|
|
|
12
|
|
|
class DraftOrder extends Model |
|
13
|
|
|
{ |
|
14
|
|
|
use AdminGraphqlApiId; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @var string |
|
18
|
|
|
*/ |
|
19
|
|
|
protected $note; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @var string |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $email; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var boolean |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $taxesIncluded; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $currency; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var \DateTimeInterface |
|
38
|
|
|
*/ |
|
39
|
|
|
protected $invoiceSentAt; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @var \DateTimeInterface |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $createdAt; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @var \DateTimeInterface |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $updatedAt; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var boolean |
|
53
|
|
|
*/ |
|
54
|
|
|
protected $taxExempt; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var \DateTimeInterface |
|
58
|
|
|
*/ |
|
59
|
|
|
protected $completedAt; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @var string |
|
63
|
|
|
*/ |
|
64
|
|
|
protected $name; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @var string |
|
68
|
|
|
*/ |
|
69
|
|
|
protected $status; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @var LineItem[] |
|
73
|
|
|
*/ |
|
74
|
|
|
protected $lineItems = []; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @var Address |
|
78
|
|
|
*/ |
|
79
|
|
|
protected $shippingAddress; |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @var Address |
|
83
|
|
|
*/ |
|
84
|
|
|
protected $billingAddress; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @var string |
|
88
|
|
|
*/ |
|
89
|
|
|
protected $invoiceUrl; |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @var array |
|
93
|
|
|
*/ |
|
94
|
|
|
protected $appliedDiscount; |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @var int |
|
98
|
|
|
*/ |
|
99
|
|
|
protected $orderId; |
|
100
|
|
|
|
|
101
|
|
|
/** |
|
102
|
|
|
* @var array |
|
103
|
|
|
*/ |
|
104
|
|
|
protected $shippingLine; |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @var TaxLine[] |
|
108
|
|
|
*/ |
|
109
|
|
|
protected $taxLines; |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* @var string |
|
113
|
|
|
*/ |
|
114
|
|
|
protected $tag; |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @var string |
|
118
|
|
|
*/ |
|
119
|
|
|
protected $noteAttributes; |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @var float |
|
123
|
|
|
*/ |
|
124
|
|
|
protected $totalPrice; |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* @var float |
|
128
|
|
|
*/ |
|
129
|
|
|
protected $subtotalPrice; |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @var float |
|
133
|
|
|
*/ |
|
134
|
|
|
protected $totalTax; |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* @var Customer |
|
138
|
|
|
*/ |
|
139
|
|
|
protected $customer; |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* @return string |
|
143
|
|
|
*/ |
|
144
|
|
|
public function getNote() |
|
145
|
|
|
{ |
|
146
|
|
|
return $this->note; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* @param string $note |
|
151
|
|
|
*/ |
|
152
|
|
|
public function setNote($note) |
|
153
|
|
|
{ |
|
154
|
|
|
$this->note = $note; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* @return string |
|
159
|
|
|
*/ |
|
160
|
|
|
public function getEmail() |
|
161
|
|
|
{ |
|
162
|
|
|
return $this->email; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* @param string $email |
|
167
|
|
|
*/ |
|
168
|
|
|
public function setEmail($email) |
|
169
|
|
|
{ |
|
170
|
|
|
$this->email = $email; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
/** |
|
174
|
|
|
* @return bool |
|
175
|
|
|
*/ |
|
176
|
|
|
public function isTaxesIncluded() |
|
177
|
|
|
{ |
|
178
|
|
|
return $this->taxesIncluded; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* @param bool $taxesIncluded |
|
183
|
|
|
*/ |
|
184
|
|
|
public function setTaxesIncluded($taxesIncluded) |
|
185
|
|
|
{ |
|
186
|
|
|
$this->taxesIncluded = $taxesIncluded; |
|
187
|
|
|
} |
|
188
|
|
|
|
|
189
|
|
|
/** |
|
190
|
|
|
* @return string |
|
191
|
|
|
*/ |
|
192
|
|
|
public function getCurrency() |
|
193
|
|
|
{ |
|
194
|
|
|
return $this->currency; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* @param string $currency |
|
199
|
|
|
*/ |
|
200
|
|
|
public function setCurrency($currency) |
|
201
|
|
|
{ |
|
202
|
|
|
$this->currency = $currency; |
|
203
|
|
|
} |
|
204
|
|
|
|
|
205
|
|
|
/** |
|
206
|
|
|
* @return \DateTimeInterface |
|
207
|
|
|
*/ |
|
208
|
|
|
public function getInvoiceSentAt() |
|
209
|
|
|
{ |
|
210
|
|
|
return $this->invoiceSentAt; |
|
211
|
|
|
} |
|
212
|
|
|
|
|
213
|
|
|
/** |
|
214
|
|
|
* @param \DateTimeInterface $invoiceSentAt |
|
215
|
|
|
*/ |
|
216
|
|
|
public function setInvoiceSentAt($invoiceSentAt) |
|
217
|
|
|
{ |
|
218
|
|
|
$this->invoiceSentAt = $invoiceSentAt; |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
/** |
|
222
|
|
|
* @return \DateTimeInterface |
|
223
|
|
|
*/ |
|
224
|
|
|
public function getCreatedAt() |
|
225
|
|
|
{ |
|
226
|
|
|
return $this->createdAt; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* @param \DateTimeInterface $createdAt |
|
231
|
|
|
*/ |
|
232
|
|
|
public function setCreatedAt($createdAt) |
|
233
|
|
|
{ |
|
234
|
|
|
$this->createdAt = $createdAt; |
|
235
|
|
|
} |
|
236
|
|
|
|
|
237
|
|
|
/** |
|
238
|
|
|
* @return \DateTimeInterface |
|
239
|
|
|
*/ |
|
240
|
|
|
public function getUpdatedAt() |
|
241
|
|
|
{ |
|
242
|
|
|
return $this->updatedAt; |
|
243
|
|
|
} |
|
244
|
|
|
|
|
245
|
|
|
/** |
|
246
|
|
|
* @param \DateTimeInterface $updatedAt |
|
247
|
|
|
*/ |
|
248
|
|
|
public function setUpdatedAt($updatedAt) |
|
249
|
|
|
{ |
|
250
|
|
|
$this->updatedAt = $updatedAt; |
|
251
|
|
|
} |
|
252
|
|
|
|
|
253
|
|
|
/** |
|
254
|
|
|
* @return bool |
|
255
|
|
|
*/ |
|
256
|
|
|
public function isTaxExempt() |
|
257
|
|
|
{ |
|
258
|
|
|
return $this->taxExempt; |
|
259
|
|
|
} |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @param bool $taxExempt |
|
263
|
|
|
*/ |
|
264
|
|
|
public function setTaxExempt($taxExempt) |
|
265
|
|
|
{ |
|
266
|
|
|
$this->taxExempt = $taxExempt; |
|
267
|
|
|
} |
|
268
|
|
|
|
|
269
|
|
|
/** |
|
270
|
|
|
* @return \DateTimeInterface |
|
271
|
|
|
*/ |
|
272
|
|
|
public function getCompletedAt() |
|
273
|
|
|
{ |
|
274
|
|
|
return $this->completedAt; |
|
275
|
|
|
} |
|
276
|
|
|
|
|
277
|
|
|
/** |
|
278
|
|
|
* @param \DateTimeInterface $completedAt |
|
279
|
|
|
*/ |
|
280
|
|
|
public function setCompletedAt($completedAt) |
|
281
|
|
|
{ |
|
282
|
|
|
$this->completedAt = $completedAt; |
|
283
|
|
|
} |
|
284
|
|
|
|
|
285
|
|
|
/** |
|
286
|
|
|
* @return string |
|
287
|
|
|
*/ |
|
288
|
|
|
public function getName() |
|
289
|
|
|
{ |
|
290
|
|
|
return $this->name; |
|
291
|
|
|
} |
|
292
|
|
|
|
|
293
|
|
|
/** |
|
294
|
|
|
* @param string $name |
|
295
|
|
|
*/ |
|
296
|
|
|
public function setName($name) |
|
297
|
|
|
{ |
|
298
|
|
|
$this->name = $name; |
|
299
|
|
|
} |
|
300
|
|
|
|
|
301
|
|
|
/** |
|
302
|
|
|
* @return string |
|
303
|
|
|
*/ |
|
304
|
|
|
public function getStatus() |
|
305
|
|
|
{ |
|
306
|
|
|
return $this->status; |
|
307
|
|
|
} |
|
308
|
|
|
|
|
309
|
|
|
/** |
|
310
|
|
|
* @param string $status |
|
311
|
|
|
*/ |
|
312
|
|
|
public function setStatus($status) |
|
313
|
|
|
{ |
|
314
|
|
|
$this->status = $status; |
|
315
|
|
|
} |
|
316
|
|
|
|
|
317
|
|
|
/** |
|
318
|
|
|
* @return LineItem[] |
|
319
|
|
|
*/ |
|
320
|
|
|
public function getLineItems() |
|
321
|
|
|
{ |
|
322
|
|
|
return $this->lineItems; |
|
323
|
|
|
} |
|
324
|
|
|
|
|
325
|
|
|
/** |
|
326
|
|
|
* @param LineItem[] $lineItems |
|
327
|
|
|
*/ |
|
328
|
|
|
public function setLineItems($lineItems) |
|
329
|
|
|
{ |
|
330
|
|
|
$this->lineItems = $lineItems; |
|
331
|
|
|
} |
|
332
|
|
|
|
|
333
|
|
|
/** |
|
334
|
|
|
* @return Address |
|
335
|
|
|
*/ |
|
336
|
|
|
public function getShippingAddress() |
|
337
|
|
|
{ |
|
338
|
|
|
return $this->shippingAddress; |
|
339
|
|
|
} |
|
340
|
|
|
|
|
341
|
|
|
/** |
|
342
|
|
|
* @param Address $shippingAddress |
|
343
|
|
|
*/ |
|
344
|
|
|
public function setShippingAddress($shippingAddress) |
|
345
|
|
|
{ |
|
346
|
|
|
$this->shippingAddress = $shippingAddress; |
|
347
|
|
|
} |
|
348
|
|
|
|
|
349
|
|
|
/** |
|
350
|
|
|
* @return Address |
|
351
|
|
|
*/ |
|
352
|
|
|
public function getBillingAddress() |
|
353
|
|
|
{ |
|
354
|
|
|
return $this->billingAddress; |
|
355
|
|
|
} |
|
356
|
|
|
|
|
357
|
|
|
/** |
|
358
|
|
|
* @param Address $billingAddress |
|
359
|
|
|
*/ |
|
360
|
|
|
public function setBillingAddress($billingAddress) |
|
361
|
|
|
{ |
|
362
|
|
|
$this->billingAddress = $billingAddress; |
|
363
|
|
|
} |
|
364
|
|
|
|
|
365
|
|
|
/** |
|
366
|
|
|
* @return string |
|
367
|
|
|
*/ |
|
368
|
|
|
public function getInvoiceUrl() |
|
369
|
|
|
{ |
|
370
|
|
|
return $this->invoiceUrl; |
|
371
|
|
|
} |
|
372
|
|
|
|
|
373
|
|
|
/** |
|
374
|
|
|
* @param string $invoiceUrl |
|
375
|
|
|
*/ |
|
376
|
|
|
public function setInvoiceUrl($invoiceUrl) |
|
377
|
|
|
{ |
|
378
|
|
|
$this->invoiceUrl = $invoiceUrl; |
|
379
|
|
|
} |
|
380
|
|
|
|
|
381
|
|
|
/** |
|
382
|
|
|
* @return array |
|
383
|
|
|
*/ |
|
384
|
|
|
public function getAppliedDiscount() |
|
385
|
|
|
{ |
|
386
|
|
|
return $this->appliedDiscount; |
|
387
|
|
|
} |
|
388
|
|
|
|
|
389
|
|
|
/** |
|
390
|
|
|
* @param array $appliedDiscount |
|
391
|
|
|
*/ |
|
392
|
|
|
public function setAppliedDiscount($appliedDiscount) |
|
393
|
|
|
{ |
|
394
|
|
|
$this->appliedDiscount = $appliedDiscount; |
|
395
|
|
|
} |
|
396
|
|
|
|
|
397
|
|
|
/** |
|
398
|
|
|
* @return int |
|
399
|
|
|
*/ |
|
400
|
|
|
public function getOrderId() |
|
401
|
|
|
{ |
|
402
|
|
|
return $this->orderId; |
|
403
|
|
|
} |
|
404
|
|
|
|
|
405
|
|
|
/** |
|
406
|
|
|
* @param int $orderId |
|
407
|
|
|
*/ |
|
408
|
|
|
public function setOrderId($orderId) |
|
409
|
|
|
{ |
|
410
|
|
|
$this->orderId = $orderId; |
|
411
|
|
|
} |
|
412
|
|
|
|
|
413
|
|
|
/** |
|
414
|
|
|
* @return array |
|
415
|
|
|
*/ |
|
416
|
|
|
public function getShippingLine() |
|
417
|
|
|
{ |
|
418
|
|
|
return $this->shippingLine; |
|
419
|
|
|
} |
|
420
|
|
|
|
|
421
|
|
|
/** |
|
422
|
|
|
* @param array $shippingLine |
|
423
|
|
|
*/ |
|
424
|
|
|
public function setShippingLine($shippingLine) |
|
425
|
|
|
{ |
|
426
|
|
|
$this->shippingLine = $shippingLine; |
|
427
|
|
|
} |
|
428
|
|
|
|
|
429
|
|
|
/** |
|
430
|
|
|
* @return array |
|
431
|
|
|
*/ |
|
432
|
|
|
public function getTaxLines() |
|
433
|
|
|
{ |
|
434
|
|
|
return $this->taxLines; |
|
435
|
|
|
} |
|
436
|
|
|
|
|
437
|
|
|
/** |
|
438
|
|
|
* @param array $taxLines |
|
439
|
|
|
*/ |
|
440
|
|
|
public function setTaxLines($taxLines) |
|
441
|
|
|
{ |
|
442
|
|
|
$this->taxLines = $taxLines; |
|
443
|
|
|
} |
|
444
|
|
|
|
|
445
|
|
|
/** |
|
446
|
|
|
* @return string |
|
447
|
|
|
*/ |
|
448
|
|
|
public function getTag() |
|
449
|
|
|
{ |
|
450
|
|
|
return $this->tag; |
|
451
|
|
|
} |
|
452
|
|
|
|
|
453
|
|
|
/** |
|
454
|
|
|
* @param string $tag |
|
455
|
|
|
*/ |
|
456
|
|
|
public function setTag($tag) |
|
457
|
|
|
{ |
|
458
|
|
|
$this->tag = $tag; |
|
459
|
|
|
} |
|
460
|
|
|
|
|
461
|
|
|
/** |
|
462
|
|
|
* @return string |
|
463
|
|
|
*/ |
|
464
|
|
|
public function getNoteAttributes() |
|
465
|
|
|
{ |
|
466
|
|
|
return $this->noteAttributes; |
|
467
|
|
|
} |
|
468
|
|
|
|
|
469
|
|
|
/** |
|
470
|
|
|
* @param string $noteAttributes |
|
471
|
|
|
*/ |
|
472
|
|
|
public function setNoteAttributes($noteAttributes) |
|
473
|
|
|
{ |
|
474
|
|
|
$this->noteAttributes = $noteAttributes; |
|
475
|
|
|
} |
|
476
|
|
|
|
|
477
|
|
|
/** |
|
478
|
|
|
* @return float |
|
479
|
|
|
*/ |
|
480
|
|
|
public function getTotalPrice() |
|
481
|
|
|
{ |
|
482
|
|
|
return $this->totalPrice; |
|
483
|
|
|
} |
|
484
|
|
|
|
|
485
|
|
|
/** |
|
486
|
|
|
* @param float $totalPrice |
|
487
|
|
|
*/ |
|
488
|
|
|
public function setTotalPrice($totalPrice) |
|
489
|
|
|
{ |
|
490
|
|
|
$this->totalPrice = $totalPrice; |
|
491
|
|
|
} |
|
492
|
|
|
|
|
493
|
|
|
/** |
|
494
|
|
|
* @return float |
|
495
|
|
|
*/ |
|
496
|
|
|
public function getSubtotalPrice() |
|
497
|
|
|
{ |
|
498
|
|
|
return $this->subtotalPrice; |
|
499
|
|
|
} |
|
500
|
|
|
|
|
501
|
|
|
/** |
|
502
|
|
|
* @param float $subtotalPrice |
|
503
|
|
|
*/ |
|
504
|
|
|
public function setSubtotalPrice($subtotalPrice) |
|
505
|
|
|
{ |
|
506
|
|
|
$this->subtotalPrice = $subtotalPrice; |
|
507
|
|
|
} |
|
508
|
|
|
|
|
509
|
|
|
/** |
|
510
|
|
|
* @return float |
|
511
|
|
|
*/ |
|
512
|
|
|
public function getTotalTax() |
|
513
|
|
|
{ |
|
514
|
|
|
return $this->totalTax; |
|
515
|
|
|
} |
|
516
|
|
|
|
|
517
|
|
|
/** |
|
518
|
|
|
* @param float $totalTax |
|
519
|
|
|
*/ |
|
520
|
|
|
public function setTotalTax($totalTax) |
|
521
|
|
|
{ |
|
522
|
|
|
$this->totalTax = $totalTax; |
|
523
|
|
|
} |
|
524
|
|
|
|
|
525
|
|
|
/** |
|
526
|
|
|
* @return Customer |
|
527
|
|
|
*/ |
|
528
|
|
|
public function getCustomer() |
|
529
|
|
|
{ |
|
530
|
|
|
return $this->customer; |
|
531
|
|
|
} |
|
532
|
|
|
|
|
533
|
|
|
/** |
|
534
|
|
|
* @param Customer $customer |
|
535
|
|
|
*/ |
|
536
|
|
|
public function setCustomer($customer) |
|
537
|
|
|
{ |
|
538
|
|
|
$this->customer = $customer; |
|
539
|
|
|
} |
|
540
|
|
|
} |