1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the slince/shopify-api-php |
5
|
|
|
* |
6
|
|
|
* (c) Slince <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Slince\Shopify\Manager\Customer; |
13
|
|
|
|
14
|
|
|
use Slince\Shopify\Common\Model\Model; |
15
|
|
|
use Slince\Shopify\Common\Model\AdminGraphqlApiId; |
16
|
|
|
use Slince\Shopify\Manager\CustomerAddress\Address; |
17
|
|
|
|
18
|
|
|
class Customer extends Model |
19
|
|
|
{ |
20
|
|
|
use AdminGraphqlApiId; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
protected $email; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var bool |
29
|
|
|
*/ |
30
|
|
|
protected $acceptsMarketing; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var \DateTimeInterface |
34
|
|
|
*/ |
35
|
|
|
protected $createdAt; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var \DateTimeInterface |
39
|
|
|
*/ |
40
|
|
|
protected $updatedAt; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $firstName; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
protected $lastName; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var int |
54
|
|
|
*/ |
55
|
|
|
protected $ordersCount; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var string |
59
|
|
|
*/ |
60
|
|
|
protected $state; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var float |
64
|
|
|
*/ |
65
|
|
|
protected $totalSpent; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var int |
69
|
|
|
*/ |
70
|
|
|
protected $lastOrderId; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
protected $note; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var bool |
79
|
|
|
*/ |
80
|
|
|
protected $verifiedEmail; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @var string |
84
|
|
|
*/ |
85
|
|
|
protected $multipassIdentifier; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var bool |
89
|
|
|
*/ |
90
|
|
|
protected $taxExempt; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var string |
94
|
|
|
*/ |
95
|
|
|
protected $phone; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var string |
99
|
|
|
*/ |
100
|
|
|
protected $tags; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var string |
104
|
|
|
*/ |
105
|
|
|
protected $lastOrderName; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @var Address[] |
109
|
|
|
*/ |
110
|
|
|
protected $addresses; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @var Address |
114
|
|
|
*/ |
115
|
|
|
protected $defaultAddress; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @return string |
119
|
|
|
*/ |
120
|
|
|
public function getEmail() |
121
|
|
|
{ |
122
|
|
|
return $this->email; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param string $email |
127
|
|
|
* |
128
|
|
|
* @return Customer |
129
|
|
|
*/ |
130
|
|
|
public function setEmail($email) |
131
|
|
|
{ |
132
|
|
|
$this->email = $email; |
133
|
|
|
|
134
|
|
|
return $this; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @return bool |
139
|
|
|
*/ |
140
|
|
|
public function isAcceptsMarketing() |
141
|
|
|
{ |
142
|
|
|
return $this->acceptsMarketing; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* @param bool $acceptsMarketing |
147
|
|
|
* |
148
|
|
|
* @return Customer |
149
|
|
|
*/ |
150
|
|
|
public function setAcceptsMarketing($acceptsMarketing) |
151
|
|
|
{ |
152
|
|
|
$this->acceptsMarketing = $acceptsMarketing; |
153
|
|
|
|
154
|
|
|
return $this; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @return \DateTimeInterface |
159
|
|
|
*/ |
160
|
|
|
public function getCreatedAt() |
161
|
|
|
{ |
162
|
|
|
return $this->createdAt; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @param \DateTimeInterface $createdAt |
167
|
|
|
* |
168
|
|
|
* @return Customer |
169
|
|
|
*/ |
170
|
|
|
public function setCreatedAt($createdAt) |
171
|
|
|
{ |
172
|
|
|
$this->createdAt = $createdAt; |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @return \DateTimeInterface |
179
|
|
|
*/ |
180
|
|
|
public function getUpdatedAt() |
181
|
|
|
{ |
182
|
|
|
return $this->updatedAt; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* @param \DateTimeInterface $updatedAt |
187
|
|
|
* |
188
|
|
|
* @return Customer |
189
|
|
|
*/ |
190
|
|
|
public function setUpdatedAt($updatedAt) |
191
|
|
|
{ |
192
|
|
|
$this->updatedAt = $updatedAt; |
193
|
|
|
|
194
|
|
|
return $this; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @return string |
199
|
|
|
*/ |
200
|
|
|
public function getFirstName() |
201
|
|
|
{ |
202
|
|
|
return $this->firstName; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @param string $firstName |
207
|
|
|
* |
208
|
|
|
* @return Customer |
209
|
|
|
*/ |
210
|
|
|
public function setFirstName($firstName) |
211
|
|
|
{ |
212
|
|
|
$this->firstName = $firstName; |
213
|
|
|
|
214
|
|
|
return $this; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @return string |
219
|
|
|
*/ |
220
|
|
|
public function getLastName() |
221
|
|
|
{ |
222
|
|
|
return $this->lastName; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @param string $lastName |
227
|
|
|
* |
228
|
|
|
* @return Customer |
229
|
|
|
*/ |
230
|
|
|
public function setLastName($lastName) |
231
|
|
|
{ |
232
|
|
|
$this->lastName = $lastName; |
233
|
|
|
|
234
|
|
|
return $this; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @return int |
239
|
|
|
*/ |
240
|
|
|
public function getOrdersCount() |
241
|
|
|
{ |
242
|
|
|
return $this->ordersCount; |
243
|
|
|
} |
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* @param int $ordersCount |
247
|
|
|
* |
248
|
|
|
* @return Customer |
249
|
|
|
*/ |
250
|
|
|
public function setOrdersCount($ordersCount) |
251
|
|
|
{ |
252
|
|
|
$this->ordersCount = $ordersCount; |
253
|
|
|
|
254
|
|
|
return $this; |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @return string |
259
|
|
|
*/ |
260
|
|
|
public function getState() |
261
|
|
|
{ |
262
|
|
|
return $this->state; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @param string $state |
267
|
|
|
* |
268
|
|
|
* @return Customer |
269
|
|
|
*/ |
270
|
|
|
public function setState($state) |
271
|
|
|
{ |
272
|
|
|
$this->state = $state; |
273
|
|
|
|
274
|
|
|
return $this; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* @return float |
279
|
|
|
*/ |
280
|
|
|
public function getTotalSpent() |
281
|
|
|
{ |
282
|
|
|
return $this->totalSpent; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* @param float $totalSpent |
287
|
|
|
* |
288
|
|
|
* @return Customer |
289
|
|
|
*/ |
290
|
|
|
public function setTotalSpent($totalSpent) |
291
|
|
|
{ |
292
|
|
|
$this->totalSpent = $totalSpent; |
293
|
|
|
|
294
|
|
|
return $this; |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @return int |
299
|
|
|
*/ |
300
|
|
|
public function getLastOrderId() |
301
|
|
|
{ |
302
|
|
|
return $this->lastOrderId; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* @param int $lastOrderId |
307
|
|
|
* |
308
|
|
|
* @return Customer |
309
|
|
|
*/ |
310
|
|
|
public function setLastOrderId($lastOrderId) |
311
|
|
|
{ |
312
|
|
|
$this->lastOrderId = $lastOrderId; |
313
|
|
|
|
314
|
|
|
return $this; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* @return string |
319
|
|
|
*/ |
320
|
|
|
public function getNote() |
321
|
|
|
{ |
322
|
|
|
return $this->note; |
323
|
|
|
} |
324
|
|
|
|
325
|
|
|
/** |
326
|
|
|
* @param string $note |
327
|
|
|
* |
328
|
|
|
* @return Customer |
329
|
|
|
*/ |
330
|
|
|
public function setNote($note) |
331
|
|
|
{ |
332
|
|
|
$this->note = $note; |
333
|
|
|
|
334
|
|
|
return $this; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return bool |
339
|
|
|
*/ |
340
|
|
|
public function isVerifiedEmail() |
341
|
|
|
{ |
342
|
|
|
return $this->verifiedEmail; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @param bool $verifiedEmail |
347
|
|
|
* |
348
|
|
|
* @return Customer |
349
|
|
|
*/ |
350
|
|
|
public function setVerifiedEmail($verifiedEmail) |
351
|
|
|
{ |
352
|
|
|
$this->verifiedEmail = $verifiedEmail; |
353
|
|
|
|
354
|
|
|
return $this; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @return string |
359
|
|
|
*/ |
360
|
|
|
public function getMultipassIdentifier() |
361
|
|
|
{ |
362
|
|
|
return $this->multipassIdentifier; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @param string $multipassIdentifier |
367
|
|
|
* |
368
|
|
|
* @return Customer |
369
|
|
|
*/ |
370
|
|
|
public function setMultipassIdentifier($multipassIdentifier) |
371
|
|
|
{ |
372
|
|
|
$this->multipassIdentifier = $multipassIdentifier; |
373
|
|
|
|
374
|
|
|
return $this; |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
/** |
378
|
|
|
* @return bool |
379
|
|
|
*/ |
380
|
|
|
public function isTaxExempt() |
381
|
|
|
{ |
382
|
|
|
return $this->taxExempt; |
383
|
|
|
} |
384
|
|
|
|
385
|
|
|
/** |
386
|
|
|
* @param bool $taxExempt |
387
|
|
|
* |
388
|
|
|
* @return Customer |
389
|
|
|
*/ |
390
|
|
|
public function setTaxExempt($taxExempt) |
391
|
|
|
{ |
392
|
|
|
$this->taxExempt = $taxExempt; |
393
|
|
|
|
394
|
|
|
return $this; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
/** |
398
|
|
|
* @return string |
399
|
|
|
*/ |
400
|
|
|
public function getPhone() |
401
|
|
|
{ |
402
|
|
|
return $this->phone; |
403
|
|
|
} |
404
|
|
|
|
405
|
|
|
/** |
406
|
|
|
* @param string $phone |
407
|
|
|
* |
408
|
|
|
* @return Customer |
409
|
|
|
*/ |
410
|
|
|
public function setPhone($phone) |
411
|
|
|
{ |
412
|
|
|
$this->phone = $phone; |
413
|
|
|
|
414
|
|
|
return $this; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* @return string |
419
|
|
|
*/ |
420
|
|
|
public function getTags() |
421
|
|
|
{ |
422
|
|
|
return $this->tags; |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* @param string $tags |
427
|
|
|
* |
428
|
|
|
* @return Customer |
429
|
|
|
*/ |
430
|
|
|
public function setTags($tags) |
431
|
|
|
{ |
432
|
|
|
$this->tags = $tags; |
433
|
|
|
|
434
|
|
|
return $this; |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
/** |
438
|
|
|
* @return string |
439
|
|
|
*/ |
440
|
|
|
public function getLastOrderName() |
441
|
|
|
{ |
442
|
|
|
return $this->lastOrderName; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* @param string $lastOrderName |
447
|
|
|
* |
448
|
|
|
* @return Customer |
449
|
|
|
*/ |
450
|
|
|
public function setLastOrderName($lastOrderName) |
451
|
|
|
{ |
452
|
|
|
$this->lastOrderName = $lastOrderName; |
453
|
|
|
|
454
|
|
|
return $this; |
455
|
|
|
} |
456
|
|
|
|
457
|
|
|
/** |
458
|
|
|
* @return Address[] |
459
|
|
|
*/ |
460
|
|
|
public function getAddresses() |
461
|
|
|
{ |
462
|
|
|
return $this->addresses; |
463
|
|
|
} |
464
|
|
|
|
465
|
|
|
/** |
466
|
|
|
* @param Address[] $addresses |
467
|
|
|
* |
468
|
|
|
* @return Customer |
469
|
|
|
*/ |
470
|
|
|
public function setAddresses($addresses) |
471
|
|
|
{ |
472
|
|
|
$this->addresses = $addresses; |
473
|
|
|
|
474
|
|
|
return $this; |
475
|
|
|
} |
476
|
|
|
|
477
|
|
|
/** |
478
|
|
|
* @return Address |
479
|
|
|
*/ |
480
|
|
|
public function getDefaultAddress() |
481
|
|
|
{ |
482
|
|
|
return $this->defaultAddress; |
483
|
|
|
} |
484
|
|
|
|
485
|
|
|
/** |
486
|
|
|
* @param Address $defaultAddress |
487
|
|
|
* |
488
|
|
|
* @return Customer |
489
|
|
|
*/ |
490
|
|
|
public function setDefaultAddress($defaultAddress) |
491
|
|
|
{ |
492
|
|
|
$this->defaultAddress = $defaultAddress; |
493
|
|
|
|
494
|
|
|
return $this; |
495
|
|
|
} |
496
|
|
|
} |
497
|
|
|
|