]> Raphaƫl G. Git Repositories - airbundle/blob - Entity/User.php
Switch to new page scheme
[airbundle] / Entity / User.php
1 <?php
2
3 // src/Rapsys/AirBundle/Entity/User.php
4 namespace Rapsys\AirBundle\Entity;
5
6 use Rapsys\AirBundle\Entity\Application;
7 use Rapsys\AirBundle\Entity\Group;
8 use Rapsys\AirBundle\Entity\Link;
9 use Rapsys\AirBundle\Entity\Snippet;
10 use Rapsys\UserBundle\Entity\User as BaseUser;
11
12 class User extends BaseUser {
13 /**
14 * @var string
15 */
16 protected $phone;
17
18 /**
19 * @var \Doctrine\Common\Collections\Collection
20 */
21 private $applications;
22
23 /**
24 * @var \Doctrine\Common\Collections\Collection
25 */
26 private $locations;
27
28 /**
29 * @var \Doctrine\Common\Collections\Collection
30 */
31 private $snippets;
32
33 /**
34 * @var \Doctrine\Common\Collections\Collection
35 */
36 private $subscribers;
37
38 /**
39 * @var \Doctrine\Common\Collections\Collection
40 */
41 private $subscriptions;
42
43 /**
44 * Constructor
45 *
46 * @param string $mail The user mail
47 */
48 public function __construct(string $mail) {
49 //Call parent constructor
50 parent::__construct($mail);
51
52 //Set collections
53 $this->applications = new \Doctrine\Common\Collections\ArrayCollection();
54 $this->locations = new \Doctrine\Common\Collections\ArrayCollection();
55 $this->snippets = new \Doctrine\Common\Collections\ArrayCollection();
56 $this->subscribers = new \Doctrine\Common\Collections\ArrayCollection();
57 $this->subscriptions = new \Doctrine\Common\Collections\ArrayCollection();
58 }
59
60 /**
61 * Set phone
62 *
63 * @param string $phone
64 *
65 * @return User
66 */
67 public function setPhone($phone) {
68 $this->phone = $phone;
69
70 return $this;
71 }
72
73 /**
74 * Get phone
75 *
76 * @return string
77 */
78 public function getPhone() {
79 return $this->phone;
80 }
81
82 /**
83 * Set donation
84 *
85 * @param string $donation
86 *
87 * @return User
88 */
89 public function setDonation($donation) {
90 $this->donation = $donation;
91
92 return $this;
93 }
94
95 /**
96 * Get donation
97 *
98 * @return string
99 */
100 public function getDonation() {
101 return $this->donation;
102 }
103
104 /**
105 * Set site
106 *
107 * @param string $site
108 *
109 * @return User
110 */
111 public function setSite($site) {
112 $this->site = $site;
113
114 return $this;
115 }
116
117 /**
118 * Get site
119 *
120 * @return string
121 */
122 public function getSite() {
123 return $this->site;
124 }
125
126 /**
127 * Add application
128 *
129 * @param \Rapsys\AirBundle\Entity\Application $application
130 *
131 * @return User
132 */
133 public function addApplication(Application $application) {
134 $this->applications[] = $application;
135
136 return $this;
137 }
138
139 /**
140 * Remove application
141 *
142 * @param \Rapsys\AirBundle\Entity\Application $application
143 */
144 public function removeApplication(Application $application) {
145 $this->applications->removeElement($application);
146 }
147
148 /**
149 * Get applications
150 *
151 * @return \Doctrine\Common\Collections\Collection
152 */
153 public function getApplications() {
154 return $this->applications;
155 }
156
157 /**
158 * Add snippet
159 *
160 * @param \Rapsys\AirBundle\Entity\Snippet $snippet
161 *
162 * @return User
163 */
164 public function addSnippet(Snippet $snippet) {
165 $this->snippets[] = $snippet;
166
167 return $this;
168 }
169
170 /**
171 * Remove snippet
172 *
173 * @param \Rapsys\AirBundle\Entity\Snippet $snippet
174 */
175 public function removeSnippet(Snippet $snippet) {
176 $this->snippets->removeElement($snippet);
177 }
178
179 /**
180 * Get snippets
181 *
182 * @return \Doctrine\Common\Collections\Collection
183 */
184 public function getSnippets() {
185 return $this->snippets;
186 }
187
188 /**
189 * Add location
190 *
191 * @param \Rapsys\AirBundle\Entity\Location $location
192 *
193 * @return User
194 */
195 public function addLocation(Location $location) {
196 $this->locations[] = $location;
197
198 return $this;
199 }
200
201 /**
202 * Remove location
203 *
204 * @param \Rapsys\AirBundle\Entity\Location $location
205 */
206 public function removeLocation(Location $location) {
207 $this->locations->removeElement($location);
208 }
209
210 /**
211 * Get locations
212 *
213 * @return \Doctrine\Common\Collections\Collection
214 */
215 public function getLocations() {
216 return $this->locations;
217 }
218
219 /**
220 * Add subscriber
221 *
222 * @param \Rapsys\AirBundle\Entity\User $subscriber
223 *
224 * @return User
225 */
226 public function addSubscriber(User $subscriber) {
227 $this->subscribers[] = $subscriber;
228
229 return $this;
230 }
231
232 /**
233 * Remove subscriber
234 *
235 * @param \Rapsys\AirBundle\Entity\User $subscriber
236 */
237 public function removeSubscriber(User $subscriber) {
238 $this->subscribers->removeElement($subscriber);
239 }
240
241 /**
242 * Get subscribers
243 *
244 * @return \Doctrine\Common\Collections\Collection
245 */
246 public function getSubscribers() {
247 return $this->subscribers;
248 }
249
250 /**
251 * Add subscription
252 *
253 * @param \Rapsys\AirBundle\Entity\User $subscription
254 *
255 * @return User
256 */
257 public function addSubscription(User $subscription) {
258 $this->subscriptions[] = $subscription;
259
260 return $this;
261 }
262
263 /**
264 * Remove subscription
265 *
266 * @param \Rapsys\AirBundle\Entity\User $subscription
267 */
268 public function removeSubscription(User $subscription) {
269 $this->subscriptions->removeElement($subscription);
270 }
271
272 /**
273 * Get subscriptions
274 *
275 * @return \Doctrine\Common\Collections\Collection
276 */
277 public function getSubscriptions() {
278 return $this->subscriptions;
279 }
280 }