]> Raphaël G. Git Repositories - airbundle/blob - Entity/User.php
Add premium as nullable
[airbundle] / Entity / User.php
1 <?php declare(strict_types=1);
2
3 /*
4 * this file is part of the rapsys packbundle package.
5 *
6 * (c) raphaël gertz <symfony@rapsys.eu>
7 *
8 * for the full copyright and license information, please view the license
9 * file that was distributed with this source code.
10 */
11
12 namespace Rapsys\AirBundle\Entity;
13
14 use Doctrine\Common\Collections\ArrayCollection;
15
16 use Rapsys\AirBundle\Entity\Application;
17 use Rapsys\AirBundle\Entity\Group;
18 use Rapsys\AirBundle\Entity\Link;
19 use Rapsys\AirBundle\Entity\Snippet;
20 use Rapsys\UserBundle\Entity\User as BaseUser;
21
22 class User extends BaseUser {
23 /**
24 * @var string
25 */
26 protected $donate;
27
28 /**
29 * @var string
30 */
31 protected $link;
32
33 /**
34 * @var string
35 */
36 protected $phone;
37
38 /**
39 * @var string
40 */
41 protected $profile;
42
43 /**
44 * @var ArrayCollection
45 */
46 private $applications;
47
48 /**
49 * @var ArrayCollection
50 */
51 private $dances;
52
53 /**
54 * @var ArrayCollection
55 */
56 private $locations;
57
58 /**
59 * @var ArrayCollection
60 */
61 private $snippets;
62
63 /**
64 * @var ArrayCollection
65 */
66 private $subscribers;
67
68 /**
69 * @var ArrayCollection
70 */
71 private $subscriptions;
72
73 /**
74 * Constructor
75 *
76 * @param string $mail The user mail
77 */
78 public function __construct(string $mail) {
79 //Call parent constructor
80 parent::__construct($mail);
81
82 //Set collections
83 $this->applications = new ArrayCollection();
84 $this->dances = new ArrayCollection();
85 $this->locations = new ArrayCollection();
86 $this->snippets = new ArrayCollection();
87 $this->subscribers = new ArrayCollection();
88 $this->subscriptions = new ArrayCollection();
89 }
90
91 /**
92 * Set donate
93 *
94 * @param string $donate
95 *
96 * @return User
97 */
98 public function setDonate(?string $donate): User {
99 $this->donate = $donate;
100
101 return $this;
102 }
103
104 /**
105 * Get donate
106 *
107 * @return string
108 */
109 public function getDonate(): ?string {
110 return $this->donate;
111 }
112
113 /**
114 * Set link
115 *
116 * @param string $link
117 *
118 * @return User
119 */
120 public function setLink(?string $link): User {
121 $this->link = $link;
122
123 return $this;
124 }
125
126 /**
127 * Get link
128 *
129 * @return string
130 */
131 public function getLink(): ?string {
132 return $this->link;
133 }
134
135 /**
136 * Set phone
137 *
138 * @param string $phone
139 *
140 * @return User
141 */
142 public function setPhone(?string $phone): User {
143 $this->phone = $phone;
144
145 return $this;
146 }
147
148 /**
149 * Get phone
150 *
151 * @return string
152 */
153 public function getPhone(): ?string {
154 return $this->phone;
155 }
156
157 /**
158 * Set profile
159 *
160 * @param string $profile
161 *
162 * @return User
163 */
164 public function setProfile(string $profile): User {
165 $this->profile = $profile;
166
167 return $this;
168 }
169
170 /**
171 * Get profile
172 *
173 * @return string
174 */
175 public function getProfile(): ?string {
176 return $this->profile;
177 }
178
179 /**
180 * Add application
181 *
182 * @param Application $application
183 *
184 * @return User
185 */
186 public function addApplication(Application $application): User {
187 $this->applications[] = $application;
188
189 return $this;
190 }
191
192 /**
193 * Remove application
194 *
195 * @param Application $application
196 */
197 public function removeApplication(Application $application): bool {
198 return $this->applications->removeElement($application);
199 }
200
201 /**
202 * Get applications
203 *
204 * @return ArrayCollection
205 */
206 public function getApplications(): ArrayCollection {
207 return $this->applications;
208 }
209
210 /**
211 * Add snippet
212 *
213 * @param Snippet $snippet
214 *
215 * @return User
216 */
217 public function addSnippet(Snippet $snippet): User {
218 $this->snippets[] = $snippet;
219
220 return $this;
221 }
222
223 /**
224 * Remove snippet
225 *
226 * @param Snippet $snippet
227 */
228 public function removeSnippet(Snippet $snippet): bool {
229 return $this->snippets->removeElement($snippet);
230 }
231
232 /**
233 * Get snippets
234 *
235 * @return ArrayCollection
236 */
237 public function getSnippets(): ArrayCollection {
238 return $this->snippets;
239 }
240
241 /**
242 * Add dance
243 *
244 * @param Dance $dance
245 *
246 * @return User
247 */
248 public function addDance(Dance $dance): User {
249 $this->dances[] = $dance;
250
251 return $this;
252 }
253
254 /**
255 * Remove dance
256 *
257 * @param Dance $dance
258 *
259 * @return bool
260 */
261 public function removeDance(Dance $dance): bool {
262 return $this->dances->removeElement($dance);
263 }
264
265 /**
266 * Get dances
267 *
268 * @return ArrayCollection
269 */
270 public function getDances(): ArrayCollection {
271 return $this->dances;
272 }
273
274 /**
275 * Add location
276 *
277 * @param Location $location
278 *
279 * @return User
280 */
281 public function addLocation(Location $location): User {
282 $this->locations[] = $location;
283
284 return $this;
285 }
286
287 /**
288 * Remove location
289 *
290 * @param Location $location
291 */
292 public function removeLocation(Location $location): bool {
293 return $this->locations->removeElement($location);
294 }
295
296 /**
297 * Get locations
298 *
299 * @return ArrayCollection
300 */
301 public function getLocations(): ArrayCollection {
302 return $this->locations;
303 }
304
305 /**
306 * Add subscriber
307 *
308 * @param User $subscriber
309 *
310 * @return User
311 */
312 public function addSubscriber(User $subscriber): User {
313 $this->subscribers[] = $subscriber;
314
315 return $this;
316 }
317
318 /**
319 * Remove subscriber
320 *
321 * @param User $subscriber
322 */
323 public function removeSubscriber(User $subscriber): bool {
324 return $this->subscribers->removeElement($subscriber);
325 }
326
327 /**
328 * Get subscribers
329 *
330 * @return ArrayCollection
331 */
332 public function getSubscribers(): ArrayCollection {
333 return $this->subscribers;
334 }
335
336 /**
337 * Add subscription
338 *
339 * @param User $subscription
340 *
341 * @return User
342 */
343 public function addSubscription(User $subscription): User {
344 $this->subscriptions[] = $subscription;
345
346 return $this;
347 }
348
349 /**
350 * Remove subscription
351 *
352 * @param User $subscription
353 */
354 public function removeSubscription(User $subscription): bool {
355 return $this->subscriptions->removeElement($subscription);
356 }
357
358 /**
359 * Get subscriptions
360 *
361 * @return ArrayCollection
362 */
363 public function getSubscriptions(): ArrayCollection {
364 return $this->subscriptions;
365 }
366 }