Complex classes like Customer often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Customer, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
62 | class Customer extends LazyFetchModelEntity |
||
63 | { |
||
64 | /* |
||
65 | * HTML Cleansing trait (Used to cleanup different properties in setters) |
||
66 | * @see \Shopware\Components\Security\AttributeCleanerTrait |
||
67 | */ |
||
68 | use AttributeCleanerTrait; |
||
69 | |||
70 | const ACCOUNT_MODE_CUSTOMER = 0; |
||
71 | const ACCOUNT_MODE_FAST_LOGIN = 1; |
||
72 | |||
73 | const CUSTOMER_TYPE_PRIVATE = 'private'; |
||
74 | const CUSTOMER_TYPE_BUSINESS = 'business'; |
||
75 | |||
76 | /** |
||
77 | * Contains the unique customer number |
||
78 | * |
||
79 | * @var string|null |
||
80 | * |
||
81 | * @ORM\Column(name="customernumber", type="string", length=30, nullable=true) |
||
82 | */ |
||
83 | protected $number = ''; |
||
84 | |||
85 | /** |
||
86 | * OWNING SIDE |
||
87 | * The group property is the owning side of the association between customer and customer group. |
||
88 | * The association is joined over the group id field and the groupkey field of the customer. |
||
89 | * |
||
90 | * @var Group |
||
91 | * |
||
92 | * @ORM\ManyToOne(targetEntity="Shopware\Models\Customer\Group", inversedBy="customers", cascade={"persist"}) |
||
93 | * @ORM\JoinColumn(name="customergroup", referencedColumnName="groupkey") |
||
94 | */ |
||
95 | protected $group; |
||
96 | |||
97 | /** |
||
98 | * INVERSE SIDE |
||
99 | * The orders property is the inverse side of the association between customer and orders. |
||
100 | * The association is joined over the customer id field and the userID field of the order. |
||
101 | * |
||
102 | * @var ArrayCollection<\Shopware\Models\Order\Order> |
||
103 | * |
||
104 | * @ORM\OneToMany(targetEntity="Shopware\Models\Order\Order", mappedBy="customer") |
||
105 | */ |
||
106 | protected $orders; |
||
107 | |||
108 | /** |
||
109 | * OWNING SIDE |
||
110 | * |
||
111 | * @var Shop |
||
112 | * |
||
113 | * @ORM\ManyToOne(targetEntity="Shopware\Models\Shop\Shop") |
||
114 | * @ORM\JoinColumn(name="subshopID", referencedColumnName="id") |
||
115 | */ |
||
116 | protected $shop; |
||
117 | |||
118 | /** |
||
119 | * INVERSE SIDE |
||
120 | * |
||
121 | * @var CustomerAttribute|null |
||
122 | * |
||
123 | * @Assert\Valid() |
||
124 | * @ORM\OneToOne(targetEntity="Shopware\Models\Attribute\Customer", mappedBy="customer", orphanRemoval=true, cascade={"persist"}) |
||
125 | */ |
||
126 | protected $attribute; |
||
127 | |||
128 | /** |
||
129 | * OWNING SIDE |
||
130 | * The price group property represents the owning side for the association between customer and customer price group. |
||
131 | * The association is joined over the pricegroup id field and the pricegroupID field of the customer. |
||
132 | * |
||
133 | * @var PriceGroup|null |
||
134 | * |
||
135 | * @ORM\ManyToOne(targetEntity="\Shopware\Models\Customer\PriceGroup", inversedBy="customers") |
||
136 | * @ORM\JoinColumn(name="pricegroupID", referencedColumnName="id") |
||
137 | */ |
||
138 | protected $priceGroup; |
||
139 | |||
140 | /** |
||
141 | * INVERSE SIDE |
||
142 | * |
||
143 | * @var ArrayCollection<\Shopware\Models\Article\Notification> |
||
144 | * |
||
145 | * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Notification", mappedBy="customer") |
||
146 | */ |
||
147 | protected $notifications; |
||
148 | |||
149 | /** |
||
150 | * @var ArrayCollection<\Shopware\Models\Payment\PaymentInstance> |
||
151 | * |
||
152 | * @ORM\OneToMany(targetEntity="Shopware\Models\Payment\PaymentInstance", mappedBy="customer") |
||
153 | */ |
||
154 | protected $paymentInstances; |
||
155 | |||
156 | /** |
||
157 | * @var ArrayCollection<\Shopware\Models\Customer\PaymentData> |
||
158 | * |
||
159 | * @ORM\OneToMany(targetEntity="Shopware\Models\Customer\PaymentData", mappedBy="customer", orphanRemoval=true, cascade={"persist"}) |
||
160 | */ |
||
161 | protected $paymentData; |
||
162 | |||
163 | /** |
||
164 | * OWNING SIDE |
||
165 | * |
||
166 | * @var \Shopware\Models\Customer\Address |
||
167 | * |
||
168 | * @ORM\ManyToOne(targetEntity="\Shopware\Models\Customer\Address", inversedBy="customer") |
||
169 | * @ORM\JoinColumn(name="default_billing_address_id", referencedColumnName="id") |
||
170 | */ |
||
171 | protected $defaultBillingAddress; |
||
172 | |||
173 | /** |
||
174 | * OWNING SIDE |
||
175 | * |
||
176 | * @var \Shopware\Models\Customer\Address |
||
177 | * |
||
178 | * @ORM\ManyToOne(targetEntity="\Shopware\Models\Customer\Address", inversedBy="customer") |
||
179 | * @ORM\JoinColumn(name="default_shipping_address_id", referencedColumnName="id") |
||
180 | */ |
||
181 | protected $defaultShippingAddress; |
||
182 | |||
183 | /** |
||
184 | * @var array |
||
185 | */ |
||
186 | protected $additional; |
||
187 | |||
188 | /** |
||
189 | * The id property is an identifier property which means |
||
190 | * doctrine associations can be defined over this field |
||
191 | * |
||
192 | * @var int |
||
193 | * |
||
194 | * @ORM\Column(name="id", type="integer", nullable=false) |
||
195 | * @ORM\Id() |
||
196 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
197 | */ |
||
198 | private $id; |
||
199 | |||
200 | /** |
||
201 | * Time of the last modification of the customer |
||
202 | * |
||
203 | * @var \DateTimeInterface |
||
204 | * |
||
205 | * @ORM\Column(name="changed", type="datetime", nullable=false) |
||
206 | */ |
||
207 | private $changed; |
||
208 | |||
209 | /** |
||
210 | * Contains the id of the customer default payment method. |
||
211 | * Used for the payment association. |
||
212 | * |
||
213 | * @var int |
||
214 | * |
||
215 | * @ORM\Column(name="paymentID", type="integer", nullable=false) |
||
216 | */ |
||
217 | private $paymentId = 0; |
||
218 | |||
219 | /** |
||
220 | * Key of the assigned customer group. |
||
221 | * |
||
222 | * @var string |
||
223 | * |
||
224 | * @ORM\Column(name="customergroup", type="string", length=15, nullable=false) |
||
225 | */ |
||
226 | private $groupKey = ''; |
||
227 | |||
228 | /** |
||
229 | * Id shop where the customer has registered. |
||
230 | * |
||
231 | * @var int |
||
232 | * |
||
233 | * @ORM\Column(name="subshopID", type="integer", nullable=false) |
||
234 | */ |
||
235 | private $shopId = 0; |
||
236 | |||
237 | /** |
||
238 | * Id of the price group, which the customer is assigned |
||
239 | * |
||
240 | * @var int|null |
||
241 | * |
||
242 | * @ORM\Column(name="pricegroupID", type="integer", nullable=true) |
||
243 | */ |
||
244 | private $priceGroupId; |
||
245 | |||
246 | /** |
||
247 | * If this property is set, set password will be encoded with md5 on save. |
||
248 | * To check the customer password use the hashPassword field. |
||
249 | * |
||
250 | * @var string |
||
251 | */ |
||
252 | private $password = ''; |
||
253 | |||
254 | /** |
||
255 | * Tells which hash was used for password encryption |
||
256 | * |
||
257 | * @var string |
||
258 | * |
||
259 | * @ORM\Column(name="encoder", type="string", length=255, nullable=false) |
||
260 | */ |
||
261 | private $encoderName = 'md5'; |
||
262 | |||
263 | /** |
||
264 | * If this property is set, the password will not be encoded on save. |
||
265 | * |
||
266 | * @var string |
||
267 | */ |
||
268 | private $rawPassword; |
||
269 | |||
270 | /** |
||
271 | * Contains the md5 encoded password |
||
272 | * |
||
273 | * @var string |
||
274 | * |
||
275 | * @ORM\Column(name="password", type="string", length=1024, nullable=false) |
||
276 | */ |
||
277 | private $hashPassword = ''; |
||
278 | |||
279 | /** |
||
280 | * Flag whether the customer account is activated. |
||
281 | * |
||
282 | * @var bool |
||
283 | * |
||
284 | * @ORM\Column(name="active", type="boolean", nullable=false) |
||
285 | */ |
||
286 | private $active = 0; |
||
287 | |||
288 | /** |
||
289 | * Contains the customer email address which is used to send the order confirmation mail |
||
290 | * or the newsletter. |
||
291 | * |
||
292 | * @var string |
||
293 | * |
||
294 | * @Assert\Email(strict=false) |
||
295 | * @Assert\NotBlank() |
||
296 | * @ORM\Column(name="email", type="string", length=70, nullable=false) |
||
297 | */ |
||
298 | private $email; |
||
299 | |||
300 | /** |
||
301 | * Contains the date on which the customer account was created. |
||
302 | * |
||
303 | * @var \DateTimeInterface |
||
304 | * |
||
305 | * @ORM\Column(name="firstlogin", type="date", nullable=false) |
||
306 | */ |
||
307 | private $firstLogin; |
||
308 | |||
309 | /** |
||
310 | * Contains the date on which the customer has logged in recently. |
||
311 | * |
||
312 | * @var \DateTimeInterface |
||
313 | * |
||
314 | * @ORM\Column(name="lastlogin", type="datetime", nullable=false) |
||
315 | */ |
||
316 | private $lastLogin; |
||
317 | |||
318 | /** |
||
319 | * Flag whether the customer checks the "don't create a shop account" checkbox |
||
320 | * |
||
321 | * @var int |
||
322 | * |
||
323 | * @ORM\Column(name="accountmode", type="integer", nullable=false) |
||
324 | */ |
||
325 | private $accountMode = 0; |
||
326 | |||
327 | /** |
||
328 | * @var string |
||
329 | * |
||
330 | * @ORM\Column(name="confirmationkey", type="string", length=100, nullable=false) |
||
331 | */ |
||
332 | private $confirmationKey = ''; |
||
333 | |||
334 | /** |
||
335 | * Contains the session id of the last customer session. |
||
336 | * |
||
337 | * @var string |
||
338 | * |
||
339 | * @ORM\Column(name="sessionID", type="string", length=255, nullable=false) |
||
340 | */ |
||
341 | private $sessionId = ''; |
||
342 | |||
343 | /** |
||
344 | * Flag whether the customer wishes to receive the store newsletter |
||
345 | * |
||
346 | * @var int |
||
347 | * |
||
348 | * @ORM\Column(name="newsletter", type="integer", nullable=false) |
||
349 | */ |
||
350 | private $newsletter = 0; |
||
351 | |||
352 | /** |
||
353 | * @var string |
||
354 | * |
||
355 | * @ORM\Column(name="validation", type="string", length=255, nullable=false) |
||
356 | */ |
||
357 | private $validation = ''; |
||
358 | |||
359 | /** |
||
360 | * Flag whether the customer is a shop partner. |
||
361 | * |
||
362 | * @var int |
||
363 | * |
||
364 | * @ORM\Column(name="affiliate", type="integer", nullable=false) |
||
365 | */ |
||
366 | private $affiliate = 0; |
||
367 | |||
368 | /** |
||
369 | * Flag whether a payment default has been filed |
||
370 | * |
||
371 | * @var int |
||
372 | * |
||
373 | * @ORM\Column(name="paymentpreset", type="integer", nullable=false) |
||
374 | */ |
||
375 | private $paymentPreset = 0; |
||
376 | |||
377 | /** |
||
378 | * Id of the language sub shop |
||
379 | * |
||
380 | * @var string |
||
381 | * |
||
382 | * @ORM\Column(name="language", type="string", length=10, nullable=false) |
||
383 | */ |
||
384 | private $languageId = 1; |
||
385 | |||
386 | /** |
||
387 | * OWNING SIDE |
||
388 | * |
||
389 | * Used for the language subshop association |
||
390 | * |
||
391 | * @var Shop |
||
392 | * |
||
393 | * @ORM\ManyToOne(targetEntity="Shopware\Models\Shop\Shop") |
||
394 | * @ORM\JoinColumn(name="language", referencedColumnName="id") |
||
395 | */ |
||
396 | private $languageSubShop; |
||
397 | |||
398 | /** |
||
399 | * @var string |
||
400 | * |
||
401 | * @ORM\Column(name="referer", type="string", length=255, nullable=false) |
||
402 | */ |
||
403 | private $referer = ''; |
||
404 | |||
405 | /** |
||
406 | * Contains the internal comment for the customer. |
||
407 | * |
||
408 | * @var string |
||
409 | * |
||
410 | * @ORM\Column(name="internalcomment", type="text", nullable=false) |
||
411 | */ |
||
412 | private $internalComment = ''; |
||
413 | |||
414 | /** |
||
415 | * Count of the failed customer logins |
||
416 | * |
||
417 | * @var int |
||
418 | * |
||
419 | * @ORM\Column(name="failedlogins", type="integer", nullable=false) |
||
420 | */ |
||
421 | private $failedLogins = 0; |
||
422 | |||
423 | /** |
||
424 | * Contains the time, since the customer is logged into a session. |
||
425 | * |
||
426 | * @var \DateTimeInterface|null |
||
427 | * |
||
428 | * @ORM\Column(name="lockedUntil", type="datetime", nullable=true) |
||
429 | */ |
||
430 | private $lockedUntil; |
||
431 | |||
432 | /** |
||
433 | * @var string |
||
434 | * |
||
435 | * @Assert\NotBlank() |
||
436 | * |
||
437 | * @ORM\Column(name="salutation", type="text", nullable=false) |
||
438 | */ |
||
439 | private $salutation; |
||
440 | |||
441 | /** |
||
442 | * @var string |
||
443 | * |
||
444 | * @ORM\Column(name="title", type="text", nullable=false) |
||
445 | */ |
||
446 | private $title; |
||
447 | |||
448 | /** |
||
449 | * @var string |
||
450 | * |
||
451 | * @Assert\NotBlank() |
||
452 | * @ORM\Column(name="firstname", type="text", nullable=false) |
||
453 | */ |
||
454 | private $firstname; |
||
455 | |||
456 | /** |
||
457 | * @var string |
||
458 | * |
||
459 | * @Assert\NotBlank() |
||
460 | * @ORM\Column(name="lastname", type="text", nullable=false) |
||
461 | */ |
||
462 | private $lastname; |
||
463 | |||
464 | /** |
||
465 | * @var \DateTimeInterface |
||
466 | * |
||
467 | * @ORM\Column(name="birthday", type="date", nullable=true) |
||
468 | */ |
||
469 | private $birthday; |
||
470 | |||
471 | /** |
||
472 | * @var bool |
||
473 | * |
||
474 | * @ORM\Column(name="doubleOptinRegister", type="boolean", nullable=false) |
||
475 | */ |
||
476 | private $doubleOptinRegister; |
||
477 | |||
478 | /** |
||
479 | * @var \DateTimeInterface|null |
||
480 | * |
||
481 | * @ORM\Column(name="doubleOptinEmailSentDate", type="datetime", nullable=true) |
||
482 | */ |
||
483 | private $doubleOptinEmailSentDate; |
||
484 | |||
485 | /** |
||
486 | * @var \DateTimeInterface|null |
||
487 | * |
||
488 | * @ORM\Column(name="doubleOptinConfirmDate", type="datetime", nullable=true) |
||
489 | */ |
||
490 | private $doubleOptinConfirmDate; |
||
491 | |||
492 | /** |
||
493 | * @var string |
||
494 | */ |
||
495 | private $customerType; |
||
496 | |||
497 | /** |
||
498 | * Contains the date on which the customer account last changed the password |
||
499 | * |
||
500 | * @var \DateTimeInterface |
||
501 | * |
||
502 | * @ORM\Column(name="password_change_date", type="datetime", nullable=false) |
||
503 | */ |
||
504 | private $passwordChangeDate; |
||
505 | |||
506 | /** |
||
507 | * Contains the ID of the opt-in entry, if any available |
||
508 | * |
||
509 | * @var int |
||
510 | * |
||
511 | * @ORM\Column(name="register_opt_in_id", type="integer", nullable=true) |
||
512 | */ |
||
513 | private $registerOptInId; |
||
514 | |||
515 | public function __construct() |
||
525 | |||
526 | /** |
||
527 | * Returns the unique identifier "id" |
||
528 | * |
||
529 | * @return int |
||
530 | */ |
||
531 | public function getId() |
||
535 | |||
536 | /** |
||
537 | * @return \DateTimeInterface |
||
538 | */ |
||
539 | public function getChanged() |
||
543 | |||
544 | /** |
||
545 | * Setter method for the password column property which used for the customer login. |
||
546 | * |
||
547 | * @param string $password |
||
548 | * |
||
549 | * @return Customer |
||
550 | */ |
||
551 | public function setPassword($password) |
||
559 | |||
560 | /** |
||
561 | * Getter method for the password column property which used for the customer login. |
||
562 | * |
||
563 | * @return string |
||
564 | */ |
||
565 | public function getPassword() |
||
569 | |||
570 | /** |
||
571 | * Setter method for the rawPassword column property which used for the customer login. |
||
572 | * This property will not be hashed! |
||
573 | * |
||
574 | * @param string $rawPassword |
||
575 | */ |
||
576 | public function setRawPassword($rawPassword) |
||
582 | |||
583 | /** |
||
584 | * Setter function for the email column property of the customer. |
||
585 | * |
||
586 | * @param string $email |
||
587 | * |
||
588 | * @return Customer |
||
589 | */ |
||
590 | public function setEmail($email) |
||
596 | |||
597 | /** |
||
598 | * Getter function for the email column property of the customer. |
||
599 | * |
||
600 | * @return string |
||
601 | */ |
||
602 | public function getEmail() |
||
606 | |||
607 | /** |
||
608 | * Setter function for the active column property which is a flag whether the customer account is activated. |
||
609 | * |
||
610 | * @param bool $active |
||
611 | * |
||
612 | * @return Customer |
||
613 | */ |
||
614 | public function setActive($active) |
||
620 | |||
621 | /** |
||
622 | * Getter function for the active column property which is a flag whether the customer account is activated. |
||
623 | * |
||
624 | * @return bool |
||
625 | */ |
||
626 | public function getActive() |
||
630 | |||
631 | /** |
||
632 | * Setter function for the accountMode column property which is a flag whether the customer has activated |
||
633 | * the checkbox "don't create customer account".<br> |
||
634 | * 0 => normal account ("don't create customer account" wasn't checked)<br> |
||
635 | * 1 => hidden account ("don't create customer account" was checked) |
||
636 | * |
||
637 | * @param int $accountMode |
||
638 | * |
||
639 | * @return Customer |
||
640 | */ |
||
641 | public function setAccountMode($accountMode) |
||
647 | |||
648 | /** |
||
649 | * Getter function for the accountMode column property which is a flag whether the customer has activated |
||
650 | * the checkbox "don't create customer account".<br> |
||
651 | * 0 => normal account ("don't create customer account" wasn't checked)<br> |
||
652 | * 1 => hidden account ("don't create customer account" was checked) |
||
653 | * |
||
654 | * @return int |
||
655 | */ |
||
656 | public function getAccountMode() |
||
660 | |||
661 | /** |
||
662 | * Setter function for the confirmationKey column property. |
||
663 | * |
||
664 | * @param string $confirmationKey |
||
665 | * |
||
666 | * @return Customer |
||
667 | */ |
||
668 | public function setConfirmationKey($confirmationKey) |
||
674 | |||
675 | /** |
||
676 | * Getter function for the confirmationKey column property. |
||
677 | * |
||
678 | * @return string |
||
679 | */ |
||
680 | public function getConfirmationKey() |
||
684 | |||
685 | /** |
||
686 | * Setter function for the first login column property of the customer, which contains a DateTime object |
||
687 | * with the date when the customer creates the account. The parameter can be a DateTime object |
||
688 | * or a string with the date. If a string is passed, the string converts to an DateTime object. |
||
689 | * |
||
690 | * @param \DateTimeInterface|string $firstLogin |
||
691 | * |
||
692 | * @return Customer |
||
693 | */ |
||
694 | public function setFirstLogin($firstLogin) |
||
703 | |||
704 | /** |
||
705 | * Getter function for the first login column property of the customer, which contains a DateTime object |
||
706 | * with the date when the customer creates the account. |
||
707 | * |
||
708 | * @return \DateTimeInterface |
||
709 | */ |
||
710 | public function getFirstLogin() |
||
714 | |||
715 | /** |
||
716 | * Setter function for the last login column property of the customer, which contains a DateTime object |
||
717 | * with the date when the customer last logged in. The parameter can be a DateTime object |
||
718 | * or a string with the date. If a string is passed, the string converts to an DateTime object. |
||
719 | * |
||
720 | * @param \DateTimeInterface|string $lastLogin |
||
721 | * |
||
722 | * @return Customer |
||
723 | */ |
||
724 | public function setLastLogin($lastLogin) |
||
733 | |||
734 | /** |
||
735 | * Getter function for the last login column property of the customer, which contains a DateTime object |
||
736 | * with the date when the customer last logged in. |
||
737 | * |
||
738 | * @return \DateTimeInterface |
||
739 | */ |
||
740 | public function getLastLogin() |
||
744 | |||
745 | /** |
||
746 | * Setter function of the session id column property. Used to verify the login without the credentials. |
||
747 | * |
||
748 | * @param string $sessionId |
||
749 | * |
||
750 | * @return Customer |
||
751 | */ |
||
752 | public function setSessionId($sessionId) |
||
758 | |||
759 | /** |
||
760 | * Getter function of the session id column property. Used to verify the login without the credentials. <br> |
||
761 | * |
||
762 | * @return string |
||
763 | */ |
||
764 | public function getSessionId() |
||
768 | |||
769 | /** |
||
770 | * Setter function of the newsletter column property, which is a flag whether the customer wants to receive the newsletter. |
||
771 | * 0 => Customer don't want to receive the newsletter |
||
772 | * 1 => Customer want to receive the newsletter |
||
773 | * |
||
774 | * @param int $newsletter |
||
775 | * |
||
776 | * @return Customer |
||
777 | */ |
||
778 | public function setNewsletter($newsletter) |
||
784 | |||
785 | /** |
||
786 | * Getter function of the newsletter column property, which is a flag whether the customer wants to receive the newsletter. |
||
787 | * 0 => Customer doesn't want to receive the newsletter |
||
788 | * 1 => Customer wants to receive the newsletter |
||
789 | * |
||
790 | * @return int |
||
791 | */ |
||
792 | public function getNewsletter() |
||
796 | |||
797 | /** |
||
798 | * Setter function of the validation column property. |
||
799 | * |
||
800 | * @param string $validation |
||
801 | * |
||
802 | * @return Customer |
||
803 | */ |
||
804 | public function setValidation($validation) |
||
810 | |||
811 | /** |
||
812 | * Getter function of the validation column property. |
||
813 | * |
||
814 | * @return string |
||
815 | */ |
||
816 | public function getValidation() |
||
820 | |||
821 | /** |
||
822 | * Setter function for the affiliate column property, which is a flag whether the customer is a shop partner. |
||
823 | * 0 => Customer isn't a shop partner |
||
824 | * 1 => Customer is a shop partner |
||
825 | * |
||
826 | * @param int $affiliate |
||
827 | * |
||
828 | * @return Customer |
||
829 | */ |
||
830 | public function setAffiliate($affiliate) |
||
836 | |||
837 | /** |
||
838 | * Getter function for the affiliate column property, which is a flag whether the customer is a shop partner. |
||
839 | * 0 => Customer isn't a shop partner |
||
840 | * 1 => Customer is a shop partner |
||
841 | * |
||
842 | * @return int |
||
843 | */ |
||
844 | public function getAffiliate() |
||
848 | |||
849 | /** |
||
850 | * Setter function for the paymentPreset column property, which is a flag whether a payment default has been filed |
||
851 | * |
||
852 | * @param int $paymentPreset |
||
853 | * |
||
854 | * @return Customer |
||
855 | */ |
||
856 | public function setPaymentPreset($paymentPreset) |
||
862 | |||
863 | /** |
||
864 | * Getter function for the paymentPreset column property, which is a flag whether a payment default has been filed |
||
865 | * |
||
866 | * @return int |
||
867 | */ |
||
868 | public function getPaymentPreset() |
||
872 | |||
873 | /** |
||
874 | * Setter function for the referer column property. |
||
875 | * |
||
876 | * @param string $referer |
||
877 | * |
||
878 | * @return Customer |
||
879 | */ |
||
880 | public function setReferer($referer) |
||
886 | |||
887 | /** |
||
888 | * Getter function for the referer column property. |
||
889 | * |
||
890 | * @return string |
||
891 | */ |
||
892 | public function getReferer() |
||
896 | |||
897 | /** |
||
898 | * Setter function for the internalComment column property. |
||
899 | * |
||
900 | * @param string $internalComment |
||
901 | * |
||
902 | * @return Customer |
||
903 | */ |
||
904 | public function setInternalComment($internalComment) |
||
910 | |||
911 | /** |
||
912 | * Getter function for the internalComment column property. |
||
913 | * |
||
914 | * @return string |
||
915 | */ |
||
916 | public function getInternalComment() |
||
920 | |||
921 | /** |
||
922 | * Setter function for the failedLogins column property. |
||
923 | * |
||
924 | * @param int $failedLogins |
||
925 | * |
||
926 | * @return Customer |
||
927 | */ |
||
928 | public function setFailedLogins($failedLogins) |
||
934 | |||
935 | /** |
||
936 | * Getter function for the failedLogins column property. |
||
937 | * |
||
938 | * @return int |
||
939 | */ |
||
940 | public function getFailedLogins() |
||
944 | |||
945 | /** |
||
946 | * Setter function for the lockedUntil column property, which contains the time since the customer is logged into a session. |
||
947 | * Expects a \DateTimeInterface object or a time string which will be converted to a \DateTime object. |
||
948 | * |
||
949 | * @param string|\DateTimeInterface|null $lockedUntil |
||
950 | * |
||
951 | * @return Customer |
||
952 | */ |
||
953 | public function setLockedUntil($lockedUntil) |
||
962 | |||
963 | /** |
||
964 | * Getter function for the lockedUntil column property, which contains the time since the customer is logged into a session. |
||
965 | * |
||
966 | * @return \DateTimeInterface|null |
||
967 | */ |
||
968 | public function getLockedUntil() |
||
972 | |||
973 | /** |
||
974 | * Event listener method which is fired when the model is saved. |
||
975 | * This method will also initialize the date time fields if these fields are null. |
||
976 | * |
||
977 | * @ORM\PrePersist() |
||
978 | * |
||
979 | * @throws \LogicException (See AttributeCleanerTrait) |
||
980 | */ |
||
981 | public function onSave() |
||
997 | |||
998 | /** |
||
999 | * Event listener method which is fired when the model is updated. |
||
1000 | * |
||
1001 | * @ORM\PreUpdate() |
||
1002 | * |
||
1003 | * @throws \LogicException (See AttributeCleanerTrait) |
||
1004 | */ |
||
1005 | public function onUpdate() |
||
1022 | |||
1023 | /** |
||
1024 | * @return CustomerAttribute|null |
||
1025 | */ |
||
1026 | public function getAttribute() |
||
1030 | |||
1031 | /** |
||
1032 | * @param CustomerAttribute|array|null $attribute |
||
1033 | * |
||
1034 | * @return Customer |
||
1035 | */ |
||
1036 | public function setAttribute($attribute) |
||
1040 | |||
1041 | /** |
||
1042 | * OWNING SIDE |
||
1043 | * Getter function for the shop association property which contains an instance of the Shopware\Models\Shop\Shop model. |
||
1044 | * The shop models contains all data about the shop, on which the customer has registered. |
||
1045 | * The shop association is only used on the customer side. |
||
1046 | * |
||
1047 | * of the association between customers and shop |
||
1048 | * |
||
1049 | * @return Shop |
||
1050 | */ |
||
1051 | public function getShop() |
||
1055 | |||
1056 | /** |
||
1057 | * Setter function for the shop association property which contains an instance of the Shopware\Models\Shop\Shop model. |
||
1058 | * The shop models contains all data about the shop, on which the customer has registered. |
||
1059 | * The shop association is only used on the customer side. |
||
1060 | * |
||
1061 | * @param Shop|array|null $shop |
||
1062 | * |
||
1063 | * @return Customer |
||
1064 | */ |
||
1065 | public function setShop($shop) |
||
1071 | |||
1072 | /** |
||
1073 | * Returns an array collection of Shopware\Models\Order\Order model instances, which |
||
1074 | * contains all data about the a single customer order. The association is defined over |
||
1075 | * the Customer.orders property (INVERSE SIDE) and the Order.customer (OWNING SIDE) property. |
||
1076 | * The order data is joined over the s_order.userID field. |
||
1077 | * |
||
1078 | * @return ArrayCollection<\Shopware\Models\Order\Order> |
||
|
|||
1079 | */ |
||
1080 | public function getOrders() |
||
1084 | |||
1085 | /** |
||
1086 | * Setter function for the orders association property which contains many instances of the Shopware\Models\Order\Order model which |
||
1087 | * contains all data about the a single customer order. The association is defined over |
||
1088 | * the Customer.orders property (INVERSE SIDE) and the Order.customer (OWNING SIDE) property. |
||
1089 | * The order data is joined over the s_order.userID field. |
||
1090 | * |
||
1091 | * @param ArrayCollection<\Shopware\Models\Order\Order>|null $orders |
||
1092 | * |
||
1093 | * @return Customer |
||
1094 | */ |
||
1095 | public function setOrders($orders) |
||
1101 | |||
1102 | /** |
||
1103 | * OWNING SIDE |
||
1104 | * Returns the instance of the Shopware\Models\Customer\Group model which |
||
1105 | * contains all data about the customer group. The association is defined over |
||
1106 | * the Customer.group property (OWNING SIDE) and the Group.customers (INVERSE SIDE) property. |
||
1107 | * The group data is joined over the s_core_customergroup.id field. |
||
1108 | * |
||
1109 | * of the association between customers and group |
||
1110 | * |
||
1111 | * @return Group|null |
||
1112 | */ |
||
1113 | public function getGroup() |
||
1120 | |||
1121 | /** |
||
1122 | * Setter function for the group association property which contains an instance of the Shopware\Models\Customer\Group model which |
||
1123 | * contains all data about the customer group. The association is defined over |
||
1124 | * the Customer.group property (OWNING SIDE) and the Group.customers (INVERSE SIDE) property. |
||
1125 | * The group data is joined over the s_core_customergroup.id field. |
||
1126 | * |
||
1127 | * @param Group|array $group |
||
1128 | * |
||
1129 | * @return Customer |
||
1130 | */ |
||
1131 | public function setGroup($group) |
||
1135 | |||
1136 | /** |
||
1137 | * @return int |
||
1138 | */ |
||
1139 | public function getPaymentId() |
||
1143 | |||
1144 | /** |
||
1145 | * @param int $paymentId |
||
1146 | */ |
||
1147 | public function setPaymentId($paymentId) |
||
1151 | |||
1152 | /** |
||
1153 | * @return PriceGroup|null |
||
1154 | */ |
||
1155 | public function getPriceGroup() |
||
1159 | |||
1160 | /** |
||
1161 | * @param PriceGroup|null $priceGroup |
||
1162 | */ |
||
1163 | public function setPriceGroup($priceGroup) |
||
1167 | |||
1168 | public function setLanguageSubShop(Shop $languageSubShop) |
||
1175 | |||
1176 | /** |
||
1177 | * @return Shop |
||
1178 | */ |
||
1179 | public function getLanguageSubShop() |
||
1183 | |||
1184 | public function setLanguageId(string $languageId): void |
||
1188 | |||
1189 | public function getLanguageId(): string |
||
1193 | |||
1194 | /** |
||
1195 | * @param ArrayCollection<\Shopware\Models\Payment\PaymentInstance> $paymentInstances |
||
1196 | */ |
||
1197 | public function setPaymentInstances($paymentInstances) |
||
1201 | |||
1202 | /** |
||
1203 | * @return ArrayCollection<\Shopware\Models\Payment\PaymentInstance> |
||
1204 | */ |
||
1205 | public function getPaymentInstances() |
||
1209 | |||
1210 | /** |
||
1211 | * @param ArrayCollection<\Shopware\Models\Customer\PaymentData> $paymentData |
||
1212 | */ |
||
1213 | public function setPaymentData($paymentData) |
||
1217 | |||
1218 | /** |
||
1219 | * @return ArrayCollection<\Shopware\Models\Customer\PaymentData> |
||
1220 | */ |
||
1221 | public function getPaymentData() |
||
1225 | |||
1226 | /** |
||
1227 | * @param \Shopware\Models\Customer\PaymentData $paymentData |
||
1228 | */ |
||
1229 | public function addPaymentData(PaymentData $paymentData) |
||
1235 | |||
1236 | /** |
||
1237 | * @return string |
||
1238 | */ |
||
1239 | public function getGroupKey() |
||
1243 | |||
1244 | /** |
||
1245 | * @return Address|null |
||
1246 | */ |
||
1247 | public function getDefaultBillingAddress() |
||
1251 | |||
1252 | /** |
||
1253 | * @param Address $defaultBillingAddress |
||
1254 | * |
||
1255 | * @return ModelEntity |
||
1256 | */ |
||
1257 | public function setDefaultBillingAddress($defaultBillingAddress) |
||
1261 | |||
1262 | /** |
||
1263 | * @return Address|null |
||
1264 | */ |
||
1265 | public function getDefaultShippingAddress() |
||
1269 | |||
1270 | /** |
||
1271 | * @param Address $defaultShippingAddress |
||
1272 | * |
||
1273 | * @return ModelEntity |
||
1274 | */ |
||
1275 | public function setDefaultShippingAddress($defaultShippingAddress) |
||
1279 | |||
1280 | /** |
||
1281 | * @return string |
||
1282 | */ |
||
1283 | public function getSalutation() |
||
1287 | |||
1288 | /** |
||
1289 | * @param string $salutation |
||
1290 | */ |
||
1291 | public function setSalutation($salutation) |
||
1295 | |||
1296 | /** |
||
1297 | * @return string |
||
1298 | */ |
||
1299 | public function getTitle() |
||
1303 | |||
1304 | /** |
||
1305 | * @param string $title |
||
1306 | */ |
||
1307 | public function setTitle($title) |
||
1311 | |||
1312 | /** |
||
1313 | * @return string |
||
1314 | */ |
||
1315 | public function getFirstname() |
||
1319 | |||
1320 | /** |
||
1321 | * @param string $firstname |
||
1322 | */ |
||
1323 | public function setFirstname($firstname) |
||
1327 | |||
1328 | /** |
||
1329 | * @return string |
||
1330 | */ |
||
1331 | public function getLastname() |
||
1335 | |||
1336 | /** |
||
1337 | * @param string $lastname |
||
1338 | */ |
||
1339 | public function setLastname($lastname) |
||
1343 | |||
1344 | /** |
||
1345 | * @return \DateTimeInterface |
||
1346 | */ |
||
1347 | public function getBirthday() |
||
1351 | |||
1352 | /** |
||
1353 | * @param \DateTimeInterface|string|null $birthday |
||
1354 | */ |
||
1355 | public function setBirthday($birthday = null) |
||
1363 | |||
1364 | /** |
||
1365 | * @return string |
||
1366 | */ |
||
1367 | public function getEncoderName() |
||
1371 | |||
1372 | /** |
||
1373 | * @param string $encoderName |
||
1374 | */ |
||
1375 | public function setEncoderName($encoderName) |
||
1379 | |||
1380 | /** |
||
1381 | * @return string|null |
||
1382 | */ |
||
1383 | public function getNumber() |
||
1387 | |||
1388 | /** |
||
1389 | * @param string|null $number |
||
1390 | */ |
||
1391 | public function setNumber($number) |
||
1395 | |||
1396 | /** |
||
1397 | * @return string |
||
1398 | */ |
||
1399 | public function getCustomerType() |
||
1403 | |||
1404 | /** |
||
1405 | * @param string $customerType |
||
1406 | */ |
||
1407 | public function setCustomerType($customerType) |
||
1411 | |||
1412 | /** |
||
1413 | * @return array |
||
1414 | */ |
||
1415 | public function getAdditional() |
||
1419 | |||
1420 | /** |
||
1421 | * @param array $additional |
||
1422 | */ |
||
1423 | public function setAdditional($additional) |
||
1427 | |||
1428 | /** |
||
1429 | * @return bool |
||
1430 | */ |
||
1431 | public function getDoubleOptinRegister() |
||
1435 | |||
1436 | /** |
||
1437 | * @param bool $doubleOptinRegister |
||
1438 | */ |
||
1439 | public function setDoubleOptinRegister($doubleOptinRegister) |
||
1443 | |||
1444 | /** |
||
1445 | * @return \DateTimeInterface|null |
||
1446 | */ |
||
1447 | public function getDoubleOptinEmailSentDate() |
||
1451 | |||
1452 | /** |
||
1453 | * @param \DateTimeInterface|null $doubleOptinEmailSentDate |
||
1454 | */ |
||
1455 | public function setDoubleOptinEmailSentDate($doubleOptinEmailSentDate) |
||
1459 | |||
1460 | /** |
||
1461 | * @return \DateTimeInterface|null |
||
1462 | */ |
||
1463 | public function getDoubleOptinConfirmDate() |
||
1467 | |||
1468 | /** |
||
1469 | * @param \DateTimeInterface|null $doubleOptinConfirmDate |
||
1470 | */ |
||
1471 | public function setDoubleOptinConfirmDate($doubleOptinConfirmDate) |
||
1475 | |||
1476 | public function getPasswordChangeDate(): \DateTimeInterface |
||
1480 | |||
1481 | /** |
||
1482 | * @ORM\PrePersist() |
||
1483 | * @ORM\PreUpdate() |
||
1484 | */ |
||
1485 | public function updateChangedTimestamp() |
||
1489 | |||
1490 | public function getRegisterOptInId(): ?int |
||
1494 | |||
1495 | /** |
||
1496 | * @param int $registerOptInId |
||
1497 | */ |
||
1498 | public function setRegisterOptInId(int $registerOptInId = null): void |
||
1502 | } |
||
1503 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.