1 | <?php |
||
30 | class User extends AggregateRoot |
||
31 | { |
||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $name; |
||
36 | |||
37 | /** |
||
38 | * @var StringLiteral |
||
39 | */ |
||
40 | protected $fullName; |
||
41 | |||
42 | /** |
||
43 | * @var int |
||
44 | */ |
||
45 | protected $age; |
||
46 | |||
47 | /** |
||
48 | * @var EmailAddress |
||
49 | */ |
||
50 | protected $email; |
||
51 | |||
52 | /** |
||
53 | * @var ArrayListInterface |
||
54 | */ |
||
55 | protected $phonenumbers; |
||
56 | |||
57 | /** |
||
58 | * @var Phonenumber |
||
59 | */ |
||
60 | protected $fax; |
||
61 | |||
62 | /** |
||
63 | * @var Role |
||
64 | */ |
||
65 | protected $mainRole; |
||
66 | |||
67 | /** |
||
68 | * @var ArraySetInterface |
||
69 | */ |
||
70 | protected $roles; |
||
71 | |||
72 | /** |
||
73 | * @var ArrayHashMapInterface |
||
74 | */ |
||
75 | protected $languagesLevel; |
||
76 | |||
77 | /** |
||
78 | * @var ArraySetInterface |
||
79 | */ |
||
80 | protected $addresses; |
||
81 | |||
82 | /** |
||
83 | * @var ArraySetInterface |
||
84 | */ |
||
85 | protected $friends; |
||
86 | |||
87 | /** |
||
88 | * @param UserId $id |
||
89 | * @param string $name |
||
90 | * @param int $age |
||
91 | * @param string $email |
||
92 | */ |
||
93 | public function __construct(UserId $id, $name, $age, $email) |
||
107 | |||
108 | /** |
||
109 | * @return int |
||
110 | */ |
||
111 | public function age() |
||
115 | |||
116 | /** |
||
117 | * @param int $age |
||
118 | */ |
||
119 | public function setAge($age) |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | public function name() |
||
131 | |||
132 | /** |
||
133 | * @return StringLiteral |
||
134 | */ |
||
135 | public function fullName() |
||
139 | |||
140 | /** |
||
141 | * @return EmailAddress |
||
142 | */ |
||
143 | public function email() |
||
147 | |||
148 | /** |
||
149 | * @return ArrayListInterface |
||
150 | */ |
||
151 | public function phonenumbers() |
||
155 | |||
156 | /** |
||
157 | * @param Phonenumber $phonenumber |
||
158 | */ |
||
159 | public function addPhonenumber(Phonenumber $phonenumber) |
||
163 | |||
164 | /** |
||
165 | * @return Phonenumber |
||
166 | */ |
||
167 | public function fax() |
||
171 | |||
172 | /** |
||
173 | * @param Phonenumber $fax |
||
174 | */ |
||
175 | public function setFax(Phonenumber $fax) |
||
179 | |||
180 | /** |
||
181 | * @return Role |
||
182 | */ |
||
183 | public function mainRole() |
||
187 | |||
188 | /** |
||
189 | * @param Role $mainRole |
||
190 | */ |
||
191 | public function setMainRole(Role $mainRole) |
||
195 | |||
196 | /** |
||
197 | * @return ArraySetInterface |
||
198 | */ |
||
199 | public function roles() |
||
203 | |||
204 | /** |
||
205 | * @param Role $role |
||
206 | */ |
||
207 | public function addRole(Role $role) |
||
211 | |||
212 | /** |
||
213 | * @return ArrayHashMapInterface |
||
214 | */ |
||
215 | public function languagesLevel() |
||
219 | |||
220 | /** |
||
221 | * @param string $language |
||
222 | * @param int $level |
||
223 | * |
||
224 | * @return ArrayHashMap|ArrayHashMapInterface |
||
225 | */ |
||
226 | public function setLanguageLevel($language, $level) |
||
230 | |||
231 | /** |
||
232 | * @return ArraySetInterface |
||
233 | */ |
||
234 | public function addresses() |
||
238 | |||
239 | /** |
||
240 | * @param Address $address |
||
241 | */ |
||
242 | public function addAddress(Address $address) |
||
246 | |||
247 | /** |
||
248 | * @return ArraySetInterface |
||
249 | */ |
||
250 | public function friends() |
||
254 | |||
255 | /** |
||
256 | * @param User $friend |
||
257 | */ |
||
258 | public function addFriend(User $friend) |
||
262 | } |
||
263 |