]> Raphaƫl G. Git Repositories - airbundle/blob - Entity/Snippet.php
Add note about validating app
[airbundle] / Entity / Snippet.php
1 <?php
2
3 namespace Rapsys\AirBundle\Entity;
4
5 use Rapsys\AirBundle\Entity\Location;
6 use Rapsys\AirBundle\Entity\User;
7
8 /**
9 * Snippet
10 */
11 class Snippet {
12 /**
13 * @var integer
14 */
15 private $id;
16
17 /**
18 * @var string
19 */
20 protected $locale;
21
22 /**
23 * @var string
24 */
25 protected $description;
26
27 /**
28 * @var string
29 */
30 protected $class;
31
32 /**
33 * @var string
34 */
35 protected $short;
36
37 /**
38 * @var integer
39 */
40 protected $rate;
41
42 /**
43 * @var string
44 */
45 protected $contact;
46
47 /**
48 * @var string
49 */
50 protected $donate;
51
52 /**
53 * @var string
54 */
55 protected $link;
56
57 /**
58 * @var string
59 */
60 protected $profile;
61
62 /**
63 * @var \DateTime
64 */
65 protected $created;
66
67 /**
68 * @var \DateTime
69 */
70 protected $updated;
71
72 /**
73 * @var \Rapsys\UserBundle\Entity\Location
74 */
75 protected $location;
76
77 /**
78 * @var \Rapsys\UserBundle\Entity\User
79 */
80 protected $user;
81
82 /**
83 * Get id
84 *
85 * @return integer
86 */
87 public function getId() {
88 return $this->id;
89 }
90
91 /**
92 * Set locale
93 *
94 * @param string $locale
95 *
96 * @return Snippet
97 */
98 public function setLocale($locale) {
99 $this->locale = $locale;
100
101 return $this;
102 }
103
104 /**
105 * Get locale
106 *
107 * @return string
108 */
109 public function getLocale() {
110 return $this->locale;
111 }
112
113 /**
114 * Set description
115 *
116 * @param string $description
117 *
118 * @return Snippet
119 */
120 public function setDescription($description) {
121 $this->description = $description;
122
123 return $this;
124 }
125
126 /**
127 * Get description
128 *
129 * @return string
130 */
131 public function getDescription() {
132 return $this->description;
133 }
134
135 /**
136 * Set class
137 *
138 * @param string $class
139 *
140 * @return Snippet
141 */
142 public function setClass($class) {
143 $this->class = $class;
144
145 return $this;
146 }
147
148 /**
149 * Get class
150 *
151 * @return string
152 */
153 public function getClass() {
154 return $this->class;
155 }
156
157 /**
158 * Set short
159 *
160 * @param string $short
161 *
162 * @return Snippet
163 */
164 public function setShort($short) {
165 $this->short = $short;
166
167 return $this;
168 }
169
170 /**
171 * Get short
172 *
173 * @return string
174 */
175 public function getShort() {
176 return $this->short;
177 }
178
179 /**
180 * Set rate
181 *
182 * @param string $rate
183 *
184 * @return Snippet
185 */
186 public function setRate($rate) {
187 $this->rate = $rate;
188
189 return $this;
190 }
191
192 /**
193 * Get rate
194 *
195 * @return string
196 */
197 public function getRate() {
198 return $this->rate;
199 }
200
201 /**
202 * Set contact
203 *
204 * @param string $contact
205 *
206 * @return Snippet
207 */
208 public function setContact($contact) {
209 $this->contact = $contact;
210
211 return $this;
212 }
213
214 /**
215 * Get contact
216 *
217 * @return string
218 */
219 public function getContact() {
220 return $this->contact;
221 }
222
223 /**
224 * Set donate
225 *
226 * @param string $donate
227 *
228 * @return Snippet
229 */
230 public function setDonate($donate) {
231 $this->donate = $donate;
232
233 return $this;
234 }
235
236 /**
237 * Get donate
238 *
239 * @return string
240 */
241 public function getDonate() {
242 return $this->donate;
243 }
244
245 /**
246 * Set link
247 *
248 * @param string $link
249 *
250 * @return Snippet
251 */
252 public function setLink($link) {
253 $this->link = $link;
254
255 return $this;
256 }
257
258 /**
259 * Get link
260 *
261 * @return string
262 */
263 public function getLink() {
264 return $this->link;
265 }
266
267 /**
268 * Set profile
269 *
270 * @param string $profile
271 *
272 * @return Snippet
273 */
274 public function setProfile($profile) {
275 $this->profile = $profile;
276
277 return $this;
278 }
279
280 /**
281 * Get profile
282 *
283 * @return string
284 */
285 public function getProfile() {
286 return $this->profile;
287 }
288
289 /**
290 * Set created
291 *
292 * @param \DateTime $created
293 *
294 * @return Snippet
295 */
296 public function setCreated($created) {
297 $this->created = $created;
298
299 return $this;
300 }
301
302 /**
303 * Get created
304 *
305 * @return \DateTime
306 */
307 public function getCreated() {
308 return $this->created;
309 }
310
311 /**
312 * Set updated
313 *
314 * @param \DateTime $updated
315 *
316 * @return Snippet
317 */
318 public function setUpdated($updated) {
319 $this->updated = $updated;
320
321 return $this;
322 }
323
324 /**
325 * Get updated
326 *
327 * @return \DateTime
328 */
329 public function getUpdated() {
330 return $this->updated;
331 }
332
333 /**
334 * Set location
335 *
336 * @param Location $location
337 *
338 * @return Snippet
339 */
340 public function setLocation(Location $location) {
341 $this->location = $location;
342
343 return $this;
344 }
345
346 /**
347 * Get location
348 *
349 * @return Location
350 */
351 public function getLocation() {
352 return $this->location;
353 }
354
355 /**
356 * Set user
357 *
358 * @param User $user
359 *
360 * @return Snippet
361 */
362 public function setUser(User $user) {
363 $this->user = $user;
364
365 return $this;
366 }
367
368 /**
369 * Get user
370 *
371 * @return User
372 */
373 public function getUser() {
374 return $this->user;
375 }
376
377 /**
378 * {@inheritdoc}
379 */
380 public function preUpdate(\Doctrine\ORM\Event\PreUpdateEventArgs $eventArgs) {
381 //Check that we have an snippet instance
382 if (($snippet = $eventArgs->getEntity()) instanceof Snippet) {
383 //Set updated value
384 $snippet->setUpdated(new \DateTime('now'));
385 }
386 }
387 }