1 | <?php |
||
22 | class Customer implements CustomerInterface, GroupableInterface |
||
23 | { |
||
24 | use SoftDeletableTrait, TimestampableTrait; |
||
25 | |||
26 | /** |
||
27 | * @var mixed |
||
28 | */ |
||
29 | protected $id; |
||
30 | |||
31 | /** |
||
32 | * @var UserInterface |
||
33 | */ |
||
34 | protected $user; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $email; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $emailCanonical; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $firstName; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $lastName; |
||
55 | |||
56 | /** |
||
57 | * @var \DateTime |
||
58 | */ |
||
59 | protected $birthday; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $gender = CustomerInterface::UNKNOWN_GENDER; |
||
65 | |||
66 | /** |
||
67 | * @var Collection|GroupInterface[] |
||
68 | */ |
||
69 | protected $groups; |
||
70 | |||
71 | public function __construct() |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function getId() |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function getUser() |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function setUser(UserInterface $user = null) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function hasUser() |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function getEmail() |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function setEmail($email) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function getEmailCanonical() |
||
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | public function setEmailCanonical($emailCanonical) |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function getFullName() |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | public function getFirstName() |
||
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | public function setFirstName($firstName) |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function getLastName() |
||
175 | |||
176 | /** |
||
177 | * {@inheritdoc} |
||
178 | */ |
||
179 | public function setLastName($lastName) |
||
183 | |||
184 | /** |
||
185 | * {@inheritdoc} |
||
186 | */ |
||
187 | public function getBirthday() |
||
191 | |||
192 | /** |
||
193 | * {@inheritdoc} |
||
194 | */ |
||
195 | public function setBirthday(\DateTime $birthday = null) |
||
199 | |||
200 | /** |
||
201 | * {@inheritdoc} |
||
202 | */ |
||
203 | public function getGender() |
||
207 | |||
208 | /** |
||
209 | * {@inheritdoc} |
||
210 | */ |
||
211 | public function setGender($gender) |
||
215 | |||
216 | /** |
||
217 | * {@inheritdoc} |
||
218 | */ |
||
219 | public function isMale() |
||
223 | |||
224 | /** |
||
225 | * {@inheritdoc} |
||
226 | */ |
||
227 | public function isFemale() |
||
231 | |||
232 | /** |
||
233 | * {@inheritdoc} |
||
234 | */ |
||
235 | public function getGroups() |
||
239 | |||
240 | /** |
||
241 | * {@inheritdoc} |
||
242 | */ |
||
243 | public function hasGroup($name) |
||
247 | |||
248 | /** |
||
249 | * {@inheritdoc} |
||
250 | */ |
||
251 | public function getGroupNames() |
||
260 | |||
261 | /** |
||
262 | * {@inheritdoc} |
||
263 | */ |
||
264 | public function addGroup(GroupInterface $group) |
||
270 | |||
271 | /** |
||
272 | * {@inheritdoc} |
||
273 | */ |
||
274 | public function removeGroup(GroupInterface $group) |
||
280 | |||
281 | public function __toString() |
||
285 | |||
286 | /** |
||
287 | * @param UserInterface $user |
||
288 | */ |
||
289 | protected function assignCustomer(UserInterface $user = null) |
||
295 | } |
||
296 |