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