1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of EC-CUBE |
5
|
|
|
* |
6
|
|
|
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. |
7
|
|
|
* |
8
|
|
|
* http://www.ec-cube.co.jp/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Eccube\Entity; |
15
|
|
|
|
16
|
|
|
use Doctrine\ORM\Mapping as ORM; |
17
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
18
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
19
|
|
|
use Symfony\Component\Validator\Mapping\ClassMetadata; |
20
|
|
|
|
21
|
1 |
|
if (!class_exists('\Eccube\Entity\Customer')) { |
22
|
|
|
/** |
23
|
|
|
* Customer |
24
|
|
|
* |
25
|
|
|
* @ORM\Table(name="dtb_customer", uniqueConstraints={@ORM\UniqueConstraint(name="secret_key", columns={"secret_key"})}, indexes={@ORM\Index(name="dtb_customer_buy_times_idx", columns={"buy_times"}), @ORM\Index(name="dtb_customer_buy_total_idx", columns={"buy_total"}), @ORM\Index(name="dtb_customer_create_date_idx", columns={"create_date"}), @ORM\Index(name="dtb_customer_update_date_idx", columns={"update_date"}), @ORM\Index(name="dtb_customer_last_buy_date_idx", columns={"last_buy_date"}), @ORM\Index(name="dtb_customer_email_idx", columns={"email"})}) |
26
|
|
|
* @ORM\InheritanceType("SINGLE_TABLE") |
27
|
|
|
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255) |
28
|
|
|
* @ORM\HasLifecycleCallbacks() |
29
|
|
|
* @ORM\Entity(repositoryClass="Eccube\Repository\CustomerRepository") |
30
|
|
|
*/ |
31
|
|
|
class Customer extends \Eccube\Entity\AbstractEntity implements UserInterface, \Serializable |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* @var int |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
37
|
|
|
* @ORM\Id |
38
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
39
|
|
|
*/ |
40
|
|
|
private $id; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
* |
45
|
|
|
* @ORM\Column(name="name01", type="string", length=255) |
46
|
|
|
*/ |
47
|
|
|
private $name01; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string |
51
|
|
|
* |
52
|
|
|
* @ORM\Column(name="name02", type="string", length=255) |
53
|
|
|
*/ |
54
|
|
|
private $name02; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var string|null |
58
|
|
|
* |
59
|
|
|
* @ORM\Column(name="kana01", type="string", length=255, nullable=true) |
60
|
|
|
*/ |
61
|
|
|
private $kana01; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var string|null |
65
|
|
|
* |
66
|
|
|
* @ORM\Column(name="kana02", type="string", length=255, nullable=true) |
67
|
|
|
*/ |
68
|
|
|
private $kana02; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string|null |
72
|
|
|
* |
73
|
|
|
* @ORM\Column(name="company_name", type="string", length=255, nullable=true) |
74
|
|
|
*/ |
75
|
|
|
private $company_name; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var string|null |
79
|
|
|
* |
80
|
|
|
* @ORM\Column(name="postal_code", type="string", length=8, nullable=true) |
81
|
|
|
*/ |
82
|
|
|
private $postal_code; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var string|null |
86
|
|
|
* |
87
|
|
|
* @ORM\Column(name="addr01", type="string", length=255, nullable=true) |
88
|
|
|
*/ |
89
|
|
|
private $addr01; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @var string|null |
93
|
|
|
* |
94
|
|
|
* @ORM\Column(name="addr02", type="string", length=255, nullable=true) |
95
|
|
|
*/ |
96
|
|
|
private $addr02; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @var string |
100
|
|
|
* |
101
|
|
|
* @ORM\Column(name="email", type="string", length=255) |
102
|
|
|
*/ |
103
|
|
|
private $email; |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @var string|null |
107
|
|
|
* |
108
|
|
|
* @ORM\Column(name="phone_number", type="string", length=14, nullable=true) |
109
|
|
|
*/ |
110
|
|
|
private $phone_number; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @var \DateTime|null |
114
|
|
|
* |
115
|
|
|
* @ORM\Column(name="birth", type="datetimetz", nullable=true) |
116
|
|
|
*/ |
117
|
|
|
private $birth; |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @var string|null |
121
|
|
|
* |
122
|
|
|
* @ORM\Column(name="password", type="string", length=255) |
123
|
|
|
*/ |
124
|
|
|
private $password; |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @var string|null |
128
|
|
|
* |
129
|
|
|
* @ORM\Column(name="salt", type="string", length=255, nullable=true) |
130
|
|
|
*/ |
131
|
|
|
private $salt; |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @var string |
135
|
|
|
* |
136
|
|
|
* @ORM\Column(name="secret_key", type="string", length=255) |
137
|
|
|
*/ |
138
|
|
|
private $secret_key; |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @var \DateTime|null |
142
|
|
|
* |
143
|
|
|
* @ORM\Column(name="first_buy_date", type="datetimetz", nullable=true) |
144
|
|
|
*/ |
145
|
|
|
private $first_buy_date; |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @var \DateTime|null |
149
|
|
|
* |
150
|
|
|
* @ORM\Column(name="last_buy_date", type="datetimetz", nullable=true) |
151
|
|
|
*/ |
152
|
|
|
private $last_buy_date; |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @var string|null |
156
|
|
|
* |
157
|
|
|
* @ORM\Column(name="buy_times", type="decimal", precision=10, scale=0, nullable=true, options={"unsigned":true,"default":0}) |
158
|
|
|
*/ |
159
|
|
|
private $buy_times = 0; |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @var string|null |
163
|
|
|
* |
164
|
|
|
* @ORM\Column(name="buy_total", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0}) |
165
|
|
|
*/ |
166
|
|
|
private $buy_total = 0; |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @var string|null |
170
|
|
|
* |
171
|
|
|
* @ORM\Column(name="note", type="string", length=4000, nullable=true) |
172
|
|
|
*/ |
173
|
|
|
private $note; |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @var string|null |
177
|
|
|
* |
178
|
|
|
* @ORM\Column(name="reset_key", type="string", length=255, nullable=true) |
179
|
|
|
*/ |
180
|
|
|
private $reset_key; |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @var \DateTime|null |
184
|
|
|
* |
185
|
|
|
* @ORM\Column(name="reset_expire", type="datetimetz", nullable=true) |
186
|
|
|
*/ |
187
|
|
|
private $reset_expire; |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @var string |
191
|
|
|
* |
192
|
|
|
* @ORM\Column(name="point", type="decimal", precision=12, scale=0, options={"unsigned":false,"default":0}) |
193
|
|
|
*/ |
194
|
|
|
private $point = '0'; |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @var \DateTime |
198
|
|
|
* |
199
|
|
|
* @ORM\Column(name="create_date", type="datetimetz") |
200
|
|
|
*/ |
201
|
|
|
private $create_date; |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @var \DateTime |
205
|
|
|
* |
206
|
|
|
* @ORM\Column(name="update_date", type="datetimetz") |
207
|
|
|
*/ |
208
|
|
|
private $update_date; |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* @var \Doctrine\Common\Collections\Collection |
212
|
|
|
* |
213
|
|
|
* @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerFavoriteProduct", mappedBy="Customer", cascade={"remove"}) |
214
|
|
|
*/ |
215
|
|
|
private $CustomerFavoriteProducts; |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @var \Doctrine\Common\Collections\Collection |
219
|
|
|
* |
220
|
|
|
* @ORM\OneToMany(targetEntity="Eccube\Entity\CustomerAddress", mappedBy="Customer", cascade={"remove"}) |
221
|
|
|
* @ORM\OrderBy({ |
222
|
|
|
* "id"="ASC" |
223
|
|
|
* }) |
224
|
|
|
*/ |
225
|
|
|
private $CustomerAddresses; |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @var \Doctrine\Common\Collections\Collection |
229
|
|
|
* |
230
|
|
|
* @ORM\OneToMany(targetEntity="Eccube\Entity\Order", mappedBy="Customer") |
231
|
|
|
*/ |
232
|
|
|
private $Orders; |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* @var \Eccube\Entity\Master\CustomerStatus |
236
|
|
|
* |
237
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\CustomerStatus") |
238
|
|
|
* @ORM\JoinColumns({ |
239
|
|
|
* @ORM\JoinColumn(name="customer_status_id", referencedColumnName="id") |
240
|
|
|
* }) |
241
|
|
|
*/ |
242
|
|
|
private $Status; |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @var \Eccube\Entity\Master\Sex |
246
|
|
|
* |
247
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Sex") |
248
|
|
|
* @ORM\JoinColumns({ |
249
|
|
|
* @ORM\JoinColumn(name="sex_id", referencedColumnName="id") |
250
|
|
|
* }) |
251
|
|
|
*/ |
252
|
|
|
private $Sex; |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @var \Eccube\Entity\Master\Job |
256
|
|
|
* |
257
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Job") |
258
|
|
|
* @ORM\JoinColumns({ |
259
|
|
|
* @ORM\JoinColumn(name="job_id", referencedColumnName="id") |
260
|
|
|
* }) |
261
|
|
|
*/ |
262
|
|
|
private $Job; |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @var \Eccube\Entity\Master\Country |
266
|
|
|
* |
267
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country") |
268
|
|
|
* @ORM\JoinColumns({ |
269
|
|
|
* @ORM\JoinColumn(name="country_id", referencedColumnName="id") |
270
|
|
|
* }) |
271
|
|
|
*/ |
272
|
|
|
private $Country; |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @var \Eccube\Entity\Master\Pref |
276
|
|
|
* |
277
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref") |
278
|
|
|
* @ORM\JoinColumns({ |
279
|
|
|
* @ORM\JoinColumn(name="pref_id", referencedColumnName="id") |
280
|
|
|
* }) |
281
|
|
|
*/ |
282
|
|
|
private $Pref; |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Constructor |
286
|
|
|
*/ |
287
|
414 |
|
public function __construct() |
288
|
|
|
{ |
289
|
414 |
|
$this->CustomerFavoriteProducts = new \Doctrine\Common\Collections\ArrayCollection(); |
290
|
414 |
|
$this->CustomerAddresses = new \Doctrine\Common\Collections\ArrayCollection(); |
291
|
414 |
|
$this->Orders = new \Doctrine\Common\Collections\ArrayCollection(); |
292
|
|
|
|
293
|
414 |
|
$this->setBuyTimes(0); |
294
|
414 |
|
$this->setBuyTotal(0); |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @return string |
299
|
|
|
*/ |
300
|
|
|
public function __toString() |
301
|
|
|
{ |
302
|
|
|
return (string) ($this->getName01().' '.$this->getName02()); |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* {@inheritdoc} |
307
|
|
|
*/ |
308
|
2 |
|
public function getRoles() |
309
|
|
|
{ |
310
|
2 |
|
return ['ROLE_USER']; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* {@inheritdoc} |
315
|
|
|
*/ |
316
|
77 |
|
public function getUsername() |
317
|
|
|
{ |
318
|
77 |
|
return $this->email; |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* {@inheritdoc} |
323
|
|
|
*/ |
324
|
|
|
public function eraseCredentials() |
325
|
|
|
{ |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
// TODO: できればFormTypeで行いたい |
329
|
45 |
|
public static function loadValidatorMetadata(ClassMetadata $metadata) |
330
|
|
|
{ |
331
|
45 |
|
$metadata->addConstraint(new UniqueEntity([ |
332
|
45 |
|
'fields' => 'email', |
333
|
|
|
'message' => 'form_error.customer_already_exists', |
334
|
|
|
'repositoryMethod' => 'getNonWithdrawingCustomers', |
335
|
|
|
])); |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
/** |
339
|
|
|
* Get id. |
340
|
|
|
* |
341
|
|
|
* @return int |
342
|
|
|
*/ |
343
|
124 |
|
public function getId() |
344
|
|
|
{ |
345
|
124 |
|
return $this->id; |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
/** |
349
|
|
|
* Set name01. |
350
|
|
|
* |
351
|
|
|
* @param string $name01 |
352
|
|
|
* |
353
|
|
|
* @return Customer |
354
|
|
|
*/ |
355
|
354 |
|
public function setName01($name01) |
356
|
|
|
{ |
357
|
354 |
|
$this->name01 = $name01; |
358
|
|
|
|
359
|
354 |
|
return $this; |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
/** |
363
|
|
|
* Get name01. |
364
|
|
|
* |
365
|
|
|
* @return string |
366
|
|
|
*/ |
367
|
136 |
|
public function getName01() |
368
|
|
|
{ |
369
|
136 |
|
return $this->name01; |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* Set name02. |
374
|
|
|
* |
375
|
|
|
* @param string $name02 |
376
|
|
|
* |
377
|
|
|
* @return Customer |
378
|
|
|
*/ |
379
|
354 |
|
public function setName02($name02) |
380
|
|
|
{ |
381
|
354 |
|
$this->name02 = $name02; |
382
|
|
|
|
383
|
354 |
|
return $this; |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* Get name02. |
388
|
|
|
* |
389
|
|
|
* @return string |
390
|
|
|
*/ |
391
|
133 |
|
public function getName02() |
392
|
|
|
{ |
393
|
133 |
|
return $this->name02; |
394
|
|
|
} |
395
|
|
|
|
396
|
|
|
/** |
397
|
|
|
* Set kana01. |
398
|
|
|
* |
399
|
|
|
* @param string|null $kana01 |
400
|
|
|
* |
401
|
|
|
* @return Customer |
402
|
|
|
*/ |
403
|
354 |
|
public function setKana01($kana01 = null) |
404
|
|
|
{ |
405
|
354 |
|
$this->kana01 = $kana01; |
406
|
|
|
|
407
|
354 |
|
return $this; |
408
|
|
|
} |
409
|
|
|
|
410
|
|
|
/** |
411
|
|
|
* Get kana01. |
412
|
|
|
* |
413
|
|
|
* @return string|null |
414
|
|
|
*/ |
415
|
110 |
|
public function getKana01() |
416
|
|
|
{ |
417
|
110 |
|
return $this->kana01; |
418
|
|
|
} |
419
|
|
|
|
420
|
|
|
/** |
421
|
|
|
* Set kana02. |
422
|
|
|
* |
423
|
|
|
* @param string|null $kana02 |
424
|
|
|
* |
425
|
|
|
* @return Customer |
426
|
|
|
*/ |
427
|
354 |
|
public function setKana02($kana02 = null) |
428
|
|
|
{ |
429
|
354 |
|
$this->kana02 = $kana02; |
430
|
|
|
|
431
|
354 |
|
return $this; |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* Get kana02. |
436
|
|
|
* |
437
|
|
|
* @return string|null |
438
|
|
|
*/ |
439
|
111 |
|
public function getKana02() |
440
|
|
|
{ |
441
|
111 |
|
return $this->kana02; |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* Set companyName. |
446
|
|
|
* |
447
|
|
|
* @param string|null $companyName |
448
|
|
|
* |
449
|
|
|
* @return Customer |
450
|
|
|
*/ |
451
|
341 |
|
public function setCompanyName($companyName = null) |
452
|
|
|
{ |
453
|
341 |
|
$this->company_name = $companyName; |
454
|
|
|
|
455
|
341 |
|
return $this; |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
/** |
459
|
|
|
* Get companyName. |
460
|
|
|
* |
461
|
|
|
* @return string|null |
462
|
|
|
*/ |
463
|
106 |
|
public function getCompanyName() |
464
|
|
|
{ |
465
|
106 |
|
return $this->company_name; |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
/** |
469
|
|
|
* Set postal_code. |
470
|
|
|
* |
471
|
|
|
* @param string|null $postal_code |
472
|
|
|
* |
473
|
|
|
* @return Customer |
474
|
|
|
*/ |
475
|
354 |
|
public function setPostalCode($postal_code = null) |
476
|
|
|
{ |
477
|
354 |
|
$this->postal_code = $postal_code; |
478
|
|
|
|
479
|
354 |
|
return $this; |
480
|
|
|
} |
481
|
|
|
|
482
|
|
|
/** |
483
|
|
|
* Get postal_code. |
484
|
|
|
* |
485
|
|
|
* @return string|null |
486
|
|
|
*/ |
487
|
107 |
|
public function getPostalCode() |
488
|
|
|
{ |
489
|
107 |
|
return $this->postal_code; |
490
|
|
|
} |
491
|
|
|
|
492
|
|
|
/** |
493
|
|
|
* Set addr01. |
494
|
|
|
* |
495
|
|
|
* @param string|null $addr01 |
496
|
|
|
* |
497
|
|
|
* @return Customer |
498
|
|
|
*/ |
499
|
354 |
|
public function setAddr01($addr01 = null) |
500
|
|
|
{ |
501
|
354 |
|
$this->addr01 = $addr01; |
502
|
|
|
|
503
|
354 |
|
return $this; |
504
|
|
|
} |
505
|
|
|
|
506
|
|
|
/** |
507
|
|
|
* Get addr01. |
508
|
|
|
* |
509
|
|
|
* @return string|null |
510
|
|
|
*/ |
511
|
107 |
|
public function getAddr01() |
512
|
|
|
{ |
513
|
107 |
|
return $this->addr01; |
514
|
|
|
} |
515
|
|
|
|
516
|
|
|
/** |
517
|
|
|
* Set addr02. |
518
|
|
|
* |
519
|
|
|
* @param string|null $addr02 |
520
|
|
|
* |
521
|
|
|
* @return Customer |
522
|
|
|
*/ |
523
|
354 |
|
public function setAddr02($addr02 = null) |
524
|
|
|
{ |
525
|
354 |
|
$this->addr02 = $addr02; |
526
|
|
|
|
527
|
354 |
|
return $this; |
528
|
|
|
} |
529
|
|
|
|
530
|
|
|
/** |
531
|
|
|
* Get addr02. |
532
|
|
|
* |
533
|
|
|
* @return string|null |
534
|
|
|
*/ |
535
|
107 |
|
public function getAddr02() |
536
|
|
|
{ |
537
|
107 |
|
return $this->addr02; |
538
|
|
|
} |
539
|
|
|
|
540
|
|
|
/** |
541
|
|
|
* Set email. |
542
|
|
|
* |
543
|
|
|
* @param string $email |
544
|
|
|
* |
545
|
|
|
* @return Customer |
546
|
|
|
*/ |
547
|
354 |
|
public function setEmail($email) |
548
|
|
|
{ |
549
|
354 |
|
$this->email = $email; |
550
|
|
|
|
551
|
354 |
|
return $this; |
552
|
|
|
} |
553
|
|
|
|
554
|
|
|
/** |
555
|
|
|
* Get email. |
556
|
|
|
* |
557
|
|
|
* @return string |
558
|
|
|
*/ |
559
|
75 |
|
public function getEmail() |
560
|
|
|
{ |
561
|
75 |
|
return $this->email; |
562
|
|
|
} |
563
|
|
|
|
564
|
|
|
/** |
565
|
|
|
* Set phone_number. |
566
|
|
|
* |
567
|
|
|
* @param string|null $phone_number |
568
|
|
|
* |
569
|
|
|
* @return Customer |
570
|
|
|
*/ |
571
|
354 |
|
public function setPhoneNumber($phone_number = null) |
572
|
|
|
{ |
573
|
354 |
|
$this->phone_number = $phone_number; |
574
|
|
|
|
575
|
354 |
|
return $this; |
576
|
|
|
} |
577
|
|
|
|
578
|
|
|
/** |
579
|
|
|
* Get phone_number. |
580
|
|
|
* |
581
|
|
|
* @return string|null |
582
|
|
|
*/ |
583
|
115 |
|
public function getPhoneNumber() |
584
|
|
|
{ |
585
|
115 |
|
return $this->phone_number; |
586
|
|
|
} |
587
|
|
|
|
588
|
|
|
/** |
589
|
|
|
* Set birth. |
590
|
|
|
* |
591
|
|
|
* @param \DateTime|null $birth |
592
|
|
|
* |
593
|
|
|
* @return Customer |
594
|
|
|
*/ |
595
|
340 |
|
public function setBirth($birth = null) |
596
|
|
|
{ |
597
|
340 |
|
$this->birth = $birth; |
598
|
|
|
|
599
|
340 |
|
return $this; |
600
|
|
|
} |
601
|
|
|
|
602
|
|
|
/** |
603
|
|
|
* Get birth. |
604
|
|
|
* |
605
|
|
|
* @return \DateTime|null |
606
|
|
|
*/ |
607
|
59 |
|
public function getBirth() |
608
|
|
|
{ |
609
|
59 |
|
return $this->birth; |
610
|
|
|
} |
611
|
|
|
|
612
|
|
|
/** |
613
|
|
|
* Set password. |
614
|
|
|
* |
615
|
|
|
* @param string|null $password |
616
|
|
|
* |
617
|
|
|
* @return Customer |
618
|
|
|
*/ |
619
|
336 |
|
public function setPassword($password = null) |
620
|
|
|
{ |
621
|
336 |
|
$this->password = $password; |
622
|
|
|
|
623
|
336 |
|
return $this; |
624
|
|
|
} |
625
|
|
|
|
626
|
|
|
/** |
627
|
|
|
* Get password. |
628
|
|
|
* |
629
|
|
|
* @return string|null |
630
|
|
|
*/ |
631
|
123 |
|
public function getPassword() |
632
|
|
|
{ |
633
|
123 |
|
return $this->password; |
634
|
|
|
} |
635
|
|
|
|
636
|
|
|
/** |
637
|
|
|
* Set salt. |
638
|
|
|
* |
639
|
|
|
* @param string|null $salt |
640
|
|
|
* |
641
|
|
|
* @return Customer |
642
|
|
|
*/ |
643
|
300 |
|
public function setSalt($salt = null) |
644
|
|
|
{ |
645
|
300 |
|
$this->salt = $salt; |
646
|
|
|
|
647
|
300 |
|
return $this; |
648
|
|
|
} |
649
|
|
|
|
650
|
|
|
/** |
651
|
|
|
* Get salt. |
652
|
|
|
* |
653
|
|
|
* @return string|null |
654
|
|
|
*/ |
655
|
78 |
|
public function getSalt() |
656
|
|
|
{ |
657
|
78 |
|
return $this->salt; |
658
|
|
|
} |
659
|
|
|
|
660
|
|
|
/** |
661
|
|
|
* Set secretKey. |
662
|
|
|
* |
663
|
|
|
* @param string $secretKey |
664
|
|
|
* |
665
|
|
|
* @return Customer |
666
|
|
|
*/ |
667
|
300 |
|
public function setSecretKey($secretKey) |
668
|
|
|
{ |
669
|
300 |
|
$this->secret_key = $secretKey; |
670
|
|
|
|
671
|
300 |
|
return $this; |
672
|
|
|
} |
673
|
|
|
|
674
|
|
|
/** |
675
|
|
|
* Get secretKey. |
676
|
|
|
* |
677
|
|
|
* @return string |
678
|
|
|
*/ |
679
|
5 |
|
public function getSecretKey() |
680
|
|
|
{ |
681
|
5 |
|
return $this->secret_key; |
682
|
|
|
} |
683
|
|
|
|
684
|
|
|
/** |
685
|
|
|
* Set firstBuyDate. |
686
|
|
|
* |
687
|
|
|
* @param \DateTime|null $firstBuyDate |
688
|
|
|
* |
689
|
|
|
* @return Customer |
690
|
|
|
*/ |
691
|
12 |
|
public function setFirstBuyDate($firstBuyDate = null) |
692
|
|
|
{ |
693
|
12 |
|
$this->first_buy_date = $firstBuyDate; |
694
|
|
|
|
695
|
12 |
|
return $this; |
696
|
|
|
} |
697
|
|
|
|
698
|
|
|
/** |
699
|
|
|
* Get firstBuyDate. |
700
|
|
|
* |
701
|
|
|
* @return \DateTime|null |
702
|
|
|
*/ |
703
|
7 |
|
public function getFirstBuyDate() |
704
|
|
|
{ |
705
|
7 |
|
return $this->first_buy_date; |
706
|
|
|
} |
707
|
|
|
|
708
|
|
|
/** |
709
|
|
|
* Set lastBuyDate. |
710
|
|
|
* |
711
|
|
|
* @param \DateTime|null $lastBuyDate |
712
|
|
|
* |
713
|
|
|
* @return Customer |
714
|
|
|
*/ |
715
|
14 |
|
public function setLastBuyDate($lastBuyDate = null) |
716
|
|
|
{ |
717
|
14 |
|
$this->last_buy_date = $lastBuyDate; |
718
|
|
|
|
719
|
14 |
|
return $this; |
720
|
|
|
} |
721
|
|
|
|
722
|
|
|
/** |
723
|
|
|
* Get lastBuyDate. |
724
|
|
|
* |
725
|
|
|
* @return \DateTime|null |
726
|
|
|
*/ |
727
|
4 |
|
public function getLastBuyDate() |
728
|
|
|
{ |
729
|
4 |
|
return $this->last_buy_date; |
730
|
|
|
} |
731
|
|
|
|
732
|
|
|
/** |
733
|
|
|
* Set buyTimes. |
734
|
|
|
* |
735
|
|
|
* @param string|null $buyTimes |
736
|
|
|
* |
737
|
|
|
* @return Customer |
738
|
|
|
*/ |
739
|
414 |
|
public function setBuyTimes($buyTimes = null) |
740
|
|
|
{ |
741
|
414 |
|
$this->buy_times = $buyTimes; |
742
|
|
|
|
743
|
414 |
|
return $this; |
744
|
|
|
} |
745
|
|
|
|
746
|
|
|
/** |
747
|
|
|
* Get buyTimes. |
748
|
|
|
* |
749
|
|
|
* @return string|null |
750
|
|
|
*/ |
751
|
7 |
|
public function getBuyTimes() |
752
|
|
|
{ |
753
|
7 |
|
return $this->buy_times; |
754
|
|
|
} |
755
|
|
|
|
756
|
|
|
/** |
757
|
|
|
* Set buyTotal. |
758
|
|
|
* |
759
|
|
|
* @param string|null $buyTotal |
760
|
|
|
* |
761
|
|
|
* @return Customer |
762
|
|
|
*/ |
763
|
414 |
|
public function setBuyTotal($buyTotal = null) |
764
|
|
|
{ |
765
|
414 |
|
$this->buy_total = $buyTotal; |
766
|
|
|
|
767
|
414 |
|
return $this; |
768
|
|
|
} |
769
|
|
|
|
770
|
|
|
/** |
771
|
|
|
* Get buyTotal. |
772
|
|
|
* |
773
|
|
|
* @return string|null |
774
|
|
|
*/ |
775
|
5 |
|
public function getBuyTotal() |
776
|
|
|
{ |
777
|
5 |
|
return $this->buy_total; |
778
|
|
|
} |
779
|
|
|
|
780
|
|
|
/** |
781
|
|
|
* Set note. |
782
|
|
|
* |
783
|
|
|
* @param string|null $note |
784
|
|
|
* |
785
|
|
|
* @return Customer |
786
|
|
|
*/ |
787
|
22 |
|
public function setNote($note = null) |
788
|
|
|
{ |
789
|
22 |
|
$this->note = $note; |
790
|
|
|
|
791
|
22 |
|
return $this; |
792
|
|
|
} |
793
|
|
|
|
794
|
|
|
/** |
795
|
|
|
* Get note. |
796
|
|
|
* |
797
|
|
|
* @return string|null |
798
|
|
|
*/ |
799
|
31 |
|
public function getNote() |
800
|
|
|
{ |
801
|
31 |
|
return $this->note; |
802
|
|
|
} |
803
|
|
|
|
804
|
|
|
/** |
805
|
|
|
* Set resetKey. |
806
|
|
|
* |
807
|
|
|
* @param string|null $resetKey |
808
|
|
|
* |
809
|
|
|
* @return Customer |
810
|
|
|
*/ |
811
|
2 |
|
public function setResetKey($resetKey = null) |
812
|
|
|
{ |
813
|
2 |
|
$this->reset_key = $resetKey; |
814
|
|
|
|
815
|
2 |
|
return $this; |
816
|
|
|
} |
817
|
|
|
|
818
|
|
|
/** |
819
|
|
|
* Get resetKey. |
820
|
|
|
* |
821
|
|
|
* @return string|null |
822
|
|
|
*/ |
823
|
|
|
public function getResetKey() |
824
|
|
|
{ |
825
|
|
|
return $this->reset_key; |
826
|
|
|
} |
827
|
|
|
|
828
|
|
|
/** |
829
|
|
|
* Set resetExpire. |
830
|
|
|
* |
831
|
|
|
* @param \DateTime|null $resetExpire |
832
|
|
|
* |
833
|
|
|
* @return Customer |
834
|
|
|
*/ |
835
|
2 |
|
public function setResetExpire($resetExpire = null) |
836
|
|
|
{ |
837
|
2 |
|
$this->reset_expire = $resetExpire; |
838
|
|
|
|
839
|
2 |
|
return $this; |
840
|
|
|
} |
841
|
|
|
|
842
|
|
|
/** |
843
|
|
|
* Get resetExpire. |
844
|
|
|
* |
845
|
|
|
* @return \DateTime|null |
846
|
|
|
*/ |
847
|
|
|
public function getResetExpire() |
848
|
|
|
{ |
849
|
|
|
return $this->reset_expire; |
850
|
|
|
} |
851
|
|
|
|
852
|
|
|
/** |
853
|
|
|
* Set createDate. |
854
|
|
|
* |
855
|
|
|
* @param \DateTime $createDate |
856
|
|
|
* |
857
|
|
|
* @return Customer |
858
|
|
|
*/ |
859
|
300 |
|
public function setCreateDate($createDate) |
860
|
|
|
{ |
861
|
300 |
|
$this->create_date = $createDate; |
862
|
|
|
|
863
|
300 |
|
return $this; |
864
|
|
|
} |
865
|
|
|
|
866
|
|
|
/** |
867
|
|
|
* Get createDate. |
868
|
|
|
* |
869
|
|
|
* @return \DateTime |
870
|
|
|
*/ |
871
|
1 |
|
public function getCreateDate() |
872
|
|
|
{ |
873
|
1 |
|
return $this->create_date; |
874
|
|
|
} |
875
|
|
|
|
876
|
|
|
/** |
877
|
|
|
* Set updateDate. |
878
|
|
|
* |
879
|
|
|
* @param \DateTime $updateDate |
880
|
|
|
* |
881
|
|
|
* @return Customer |
882
|
|
|
*/ |
883
|
300 |
|
public function setUpdateDate($updateDate) |
884
|
|
|
{ |
885
|
300 |
|
$this->update_date = $updateDate; |
886
|
|
|
|
887
|
300 |
|
return $this; |
888
|
|
|
} |
889
|
|
|
|
890
|
|
|
/** |
891
|
|
|
* Get updateDate. |
892
|
|
|
* |
893
|
|
|
* @return \DateTime |
894
|
|
|
*/ |
895
|
1 |
|
public function getUpdateDate() |
896
|
|
|
{ |
897
|
1 |
|
return $this->update_date; |
898
|
|
|
} |
899
|
|
|
|
900
|
|
|
/** |
901
|
|
|
* Add customerFavoriteProduct. |
902
|
|
|
* |
903
|
|
|
* @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct |
904
|
|
|
* |
905
|
|
|
* @return Customer |
906
|
|
|
*/ |
907
|
|
|
public function addCustomerFavoriteProduct(\Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct) |
908
|
|
|
{ |
909
|
|
|
$this->CustomerFavoriteProducts[] = $customerFavoriteProduct; |
910
|
|
|
|
911
|
|
|
return $this; |
912
|
|
|
} |
913
|
|
|
|
914
|
|
|
/** |
915
|
|
|
* Remove customerFavoriteProduct. |
916
|
|
|
* |
917
|
|
|
* @param \Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct |
918
|
|
|
* |
919
|
|
|
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
920
|
|
|
*/ |
921
|
|
|
public function removeCustomerFavoriteProduct(\Eccube\Entity\CustomerFavoriteProduct $customerFavoriteProduct) |
922
|
|
|
{ |
923
|
|
|
return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct); |
924
|
|
|
} |
925
|
|
|
|
926
|
|
|
/** |
927
|
|
|
* Get customerFavoriteProducts. |
928
|
|
|
* |
929
|
|
|
* @return \Doctrine\Common\Collections\Collection |
930
|
|
|
*/ |
931
|
|
|
public function getCustomerFavoriteProducts() |
932
|
|
|
{ |
933
|
|
|
return $this->CustomerFavoriteProducts; |
934
|
|
|
} |
935
|
|
|
|
936
|
|
|
/** |
937
|
|
|
* Add customerAddress. |
938
|
|
|
* |
939
|
|
|
* @param \Eccube\Entity\CustomerAddress $customerAddress |
940
|
|
|
* |
941
|
|
|
* @return Customer |
942
|
|
|
*/ |
943
|
7 |
|
public function addCustomerAddress(\Eccube\Entity\CustomerAddress $customerAddress) |
944
|
|
|
{ |
945
|
7 |
|
$this->CustomerAddresses[] = $customerAddress; |
946
|
|
|
|
947
|
7 |
|
return $this; |
948
|
|
|
} |
949
|
|
|
|
950
|
|
|
/** |
951
|
|
|
* Remove customerAddress. |
952
|
|
|
* |
953
|
|
|
* @param \Eccube\Entity\CustomerAddress $customerAddress |
954
|
|
|
* |
955
|
|
|
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
956
|
|
|
*/ |
957
|
|
|
public function removeCustomerAddress(\Eccube\Entity\CustomerAddress $customerAddress) |
958
|
|
|
{ |
959
|
|
|
return $this->CustomerAddresses->removeElement($customerAddress); |
960
|
|
|
} |
961
|
|
|
|
962
|
|
|
/** |
963
|
|
|
* Get customerAddresses. |
964
|
|
|
* |
965
|
|
|
* @return \Doctrine\Common\Collections\Collection |
966
|
|
|
*/ |
967
|
21 |
|
public function getCustomerAddresses() |
968
|
|
|
{ |
969
|
21 |
|
return $this->CustomerAddresses; |
970
|
|
|
} |
971
|
|
|
|
972
|
|
|
/** |
973
|
|
|
* Add order. |
974
|
|
|
* |
975
|
|
|
* @param \Eccube\Entity\Order $order |
976
|
|
|
* |
977
|
|
|
* @return Customer |
978
|
|
|
*/ |
979
|
2 |
|
public function addOrder(\Eccube\Entity\Order $order) |
980
|
|
|
{ |
981
|
2 |
|
$this->Orders[] = $order; |
982
|
|
|
|
983
|
2 |
|
return $this; |
984
|
|
|
} |
985
|
|
|
|
986
|
|
|
/** |
987
|
|
|
* Remove order. |
988
|
|
|
* |
989
|
|
|
* @param \Eccube\Entity\Order $order |
990
|
|
|
* |
991
|
|
|
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
992
|
|
|
*/ |
993
|
|
|
public function removeOrder(\Eccube\Entity\Order $order) |
994
|
|
|
{ |
995
|
|
|
return $this->Orders->removeElement($order); |
996
|
|
|
} |
997
|
|
|
|
998
|
|
|
/** |
999
|
|
|
* Get orders. |
1000
|
|
|
* |
1001
|
|
|
* @return \Doctrine\Common\Collections\Collection |
1002
|
|
|
*/ |
1003
|
4 |
|
public function getOrders() |
1004
|
|
|
{ |
1005
|
4 |
|
return $this->Orders; |
1006
|
|
|
} |
1007
|
|
|
|
1008
|
|
|
/** |
1009
|
|
|
* Set status. |
1010
|
|
|
* |
1011
|
|
|
* @param \Eccube\Entity\Master\CustomerStatus|null $status |
1012
|
|
|
* |
1013
|
|
|
* @return Customer |
1014
|
|
|
*/ |
1015
|
326 |
|
public function setStatus(\Eccube\Entity\Master\CustomerStatus $status = null) |
1016
|
|
|
{ |
1017
|
326 |
|
$this->Status = $status; |
1018
|
|
|
|
1019
|
326 |
|
return $this; |
1020
|
|
|
} |
1021
|
|
|
|
1022
|
|
|
/** |
1023
|
|
|
* Get status. |
1024
|
|
|
* |
1025
|
|
|
* @return \Eccube\Entity\Master\CustomerStatus|null |
1026
|
|
|
*/ |
1027
|
39 |
|
public function getStatus() |
1028
|
|
|
{ |
1029
|
39 |
|
return $this->Status; |
1030
|
|
|
} |
1031
|
|
|
|
1032
|
|
|
/** |
1033
|
|
|
* Set sex. |
1034
|
|
|
* |
1035
|
|
|
* @param \Eccube\Entity\Master\Sex|null $sex |
1036
|
|
|
* |
1037
|
|
|
* @return Customer |
1038
|
|
|
*/ |
1039
|
338 |
|
public function setSex(\Eccube\Entity\Master\Sex $sex = null) |
1040
|
|
|
{ |
1041
|
338 |
|
$this->Sex = $sex; |
1042
|
|
|
|
1043
|
338 |
|
return $this; |
1044
|
|
|
} |
1045
|
|
|
|
1046
|
|
|
/** |
1047
|
|
|
* Get sex. |
1048
|
|
|
* |
1049
|
|
|
* @return \Eccube\Entity\Master\Sex|null |
1050
|
|
|
*/ |
1051
|
59 |
|
public function getSex() |
1052
|
|
|
{ |
1053
|
59 |
|
return $this->Sex; |
1054
|
|
|
} |
1055
|
|
|
|
1056
|
|
|
/** |
1057
|
|
|
* Set job. |
1058
|
|
|
* |
1059
|
|
|
* @param \Eccube\Entity\Master\Job|null $job |
1060
|
|
|
* |
1061
|
|
|
* @return Customer |
1062
|
|
|
*/ |
1063
|
338 |
|
public function setJob(\Eccube\Entity\Master\Job $job = null) |
1064
|
|
|
{ |
1065
|
338 |
|
$this->Job = $job; |
1066
|
|
|
|
1067
|
338 |
|
return $this; |
1068
|
|
|
} |
1069
|
|
|
|
1070
|
|
|
/** |
1071
|
|
|
* Get job. |
1072
|
|
|
* |
1073
|
|
|
* @return \Eccube\Entity\Master\Job|null |
1074
|
|
|
*/ |
1075
|
59 |
|
public function getJob() |
1076
|
|
|
{ |
1077
|
59 |
|
return $this->Job; |
1078
|
|
|
} |
1079
|
|
|
|
1080
|
|
|
/** |
1081
|
|
|
* Set country. |
1082
|
|
|
* |
1083
|
|
|
* @param \Eccube\Entity\Master\Country|null $country |
1084
|
|
|
* |
1085
|
|
|
* @return Customer |
1086
|
|
|
*/ |
1087
|
|
|
public function setCountry(\Eccube\Entity\Master\Country $country = null) |
1088
|
|
|
{ |
1089
|
|
|
$this->Country = $country; |
1090
|
|
|
|
1091
|
|
|
return $this; |
1092
|
|
|
} |
1093
|
|
|
|
1094
|
|
|
/** |
1095
|
|
|
* Get country. |
1096
|
|
|
* |
1097
|
|
|
* @return \Eccube\Entity\Master\Country|null |
1098
|
|
|
*/ |
1099
|
52 |
|
public function getCountry() |
1100
|
|
|
{ |
1101
|
52 |
|
return $this->Country; |
1102
|
|
|
} |
1103
|
|
|
|
1104
|
|
|
/** |
1105
|
|
|
* Set pref. |
1106
|
|
|
* |
1107
|
|
|
* @param \Eccube\Entity\Master\Pref|null $pref |
1108
|
|
|
* |
1109
|
|
|
* @return Customer |
1110
|
|
|
*/ |
1111
|
354 |
|
public function setPref(\Eccube\Entity\Master\Pref $pref = null) |
1112
|
|
|
{ |
1113
|
354 |
|
$this->Pref = $pref; |
1114
|
|
|
|
1115
|
354 |
|
return $this; |
1116
|
|
|
} |
1117
|
|
|
|
1118
|
|
|
/** |
1119
|
|
|
* Get pref. |
1120
|
|
|
* |
1121
|
|
|
* @return \Eccube\Entity\Master\Pref|null |
1122
|
|
|
*/ |
1123
|
126 |
|
public function getPref() |
1124
|
|
|
{ |
1125
|
126 |
|
return $this->Pref; |
1126
|
|
|
} |
1127
|
|
|
|
1128
|
|
|
/** |
1129
|
|
|
* Set point |
1130
|
|
|
* |
1131
|
|
|
* @param string $point |
1132
|
|
|
* |
1133
|
|
|
* @return Customer |
1134
|
|
|
*/ |
1135
|
375 |
|
public function setPoint($point) |
1136
|
|
|
{ |
1137
|
375 |
|
$this->point = $point; |
1138
|
|
|
|
1139
|
375 |
|
return $this; |
1140
|
|
|
} |
1141
|
|
|
|
1142
|
|
|
/** |
1143
|
|
|
* Get point |
1144
|
|
|
* |
1145
|
|
|
* @return string |
1146
|
|
|
*/ |
1147
|
133 |
|
public function getPoint() |
1148
|
|
|
{ |
1149
|
133 |
|
return $this->point; |
1150
|
|
|
} |
1151
|
|
|
|
1152
|
|
|
/** |
1153
|
|
|
* String representation of object |
1154
|
|
|
* @link http://php.net/manual/en/serializable.serialize.php |
1155
|
|
|
* @return string the string representation of the object or null |
1156
|
|
|
* @since 5.1.0 |
1157
|
|
|
*/ |
1158
|
|
|
public function serialize() |
1159
|
|
|
{ |
1160
|
|
|
// see https://symfony.com/doc/2.7/security/entity_provider.html#create-your-user-entity |
1161
|
|
|
// CustomerRepository::loadUserByUsername() で Status をチェックしているため、ここでは不要 |
1162
|
|
|
return serialize([ |
1163
|
|
|
$this->id, |
1164
|
|
|
$this->email, |
1165
|
|
|
$this->password, |
1166
|
|
|
$this->salt, |
1167
|
|
|
]); |
1168
|
|
|
} |
1169
|
|
|
|
1170
|
|
|
/** |
1171
|
|
|
* Constructs the object |
1172
|
|
|
* @link http://php.net/manual/en/serializable.unserialize.php |
1173
|
|
|
* @param string $serialized <p> |
1174
|
|
|
* The string representation of the object. |
1175
|
|
|
* </p> |
1176
|
|
|
* @return void |
1177
|
|
|
* @since 5.1.0 |
1178
|
|
|
*/ |
1179
|
|
|
public function unserialize($serialized) |
1180
|
|
|
{ |
1181
|
|
|
list ( |
1182
|
|
|
$this->id, |
1183
|
|
|
$this->email, |
1184
|
|
|
$this->password, |
1185
|
|
|
$this->salt, |
1186
|
|
|
) = unserialize($serialized); |
1187
|
|
|
} |
1188
|
|
|
} |
1189
|
|
|
} |
1190
|
|
|
|