1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace KI\UserBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use JMS\Serializer\Annotation as JMS; |
7
|
|
|
use KI\CoreBundle\Entity\Likeable; |
8
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @ORM\Entity |
12
|
|
|
* @JMS\ExclusionPolicy("all") |
13
|
|
|
*/ |
14
|
|
|
class Club extends Likeable |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* Nom complet du club |
18
|
|
|
* @ORM\Column(name="fullName", type="string") |
19
|
|
|
* @JMS\Expose |
20
|
|
|
* @Assert\Type("string") |
21
|
|
|
* @Assert\NotBlank() |
22
|
|
|
*/ |
23
|
|
|
protected $fullName; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Logo |
27
|
|
|
* @ORM\OneToOne(targetEntity="KI\CoreBundle\Entity\Image", cascade={"persist", "remove"}) |
28
|
|
|
* @Assert\Valid() |
29
|
|
|
*/ |
30
|
|
|
protected $image; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Bannière |
34
|
|
|
* @ORM\OneToOne(targetEntity="KI\CoreBundle\Entity\Image", cascade={"persist", "remove"}) |
35
|
|
|
* @Assert\Valid() |
36
|
|
|
*/ |
37
|
|
|
protected $banner; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Icône (utilisée par l'application mobile) |
41
|
|
|
* @ORM\Column(name="icon", type="string", nullable=true) |
42
|
|
|
* @JMS\Expose |
43
|
|
|
* @Assert\Type("string") |
44
|
|
|
*/ |
45
|
|
|
protected $icon; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Corps du texte |
49
|
|
|
* @ORM\Column(name="presentation", type="text", nullable=true) |
50
|
|
|
* @JMS\Expose |
51
|
|
|
* @Assert\Type("string") |
52
|
|
|
*/ |
53
|
|
|
protected $presentation; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Club actif ou non ? |
57
|
|
|
* @ORM\Column(name="active", type="boolean", nullable=true) |
58
|
|
|
* @JMS\Expose |
59
|
|
|
* @Assert\Type("boolean") |
60
|
|
|
*/ |
61
|
|
|
protected $active; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* asso | club-gastronomique/artistique/divertissement/culturel | autre |
65
|
|
|
* @ORM\Column(name="category", type="string", nullable=true) |
66
|
|
|
* @JMS\Expose |
67
|
|
|
* @Assert\Type("string") |
68
|
|
|
*/ |
69
|
|
|
protected $category; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Channel géré par l'administration ? |
73
|
|
|
* @ORM\Column(name="administration", type="boolean", nullable=true) |
74
|
|
|
* @JMS\Expose |
75
|
|
|
* @Assert\Type("boolean") |
76
|
|
|
*/ |
77
|
|
|
protected $administration; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Adresse du local |
81
|
|
|
* @ORM\Column(name="place", type="string", nullable=true) |
82
|
|
|
* @JMS\Expose |
83
|
|
|
* @Assert\Type("string") |
84
|
|
|
*/ |
85
|
|
|
protected $place; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Local ouvert ? |
89
|
|
|
* @ORM\Column(name="open", type="boolean", nullable=true, options={"default" = false}) |
90
|
|
|
* @JMS\Expose |
91
|
|
|
* @Assert\Type("boolean") |
92
|
|
|
*/ |
93
|
|
|
protected $open; |
94
|
|
|
/** |
95
|
|
|
* @JMS\VirtualProperty() |
96
|
|
|
*/ |
97
|
|
|
public function imageUrl() |
98
|
|
|
{ |
99
|
|
|
return $this->image !== null ? $this->image->getWebPath() : 'uploads/others/default-user.png'; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @JMS\VirtualProperty() |
104
|
|
|
*/ |
105
|
|
|
public function bannerUrl() |
106
|
|
|
{ |
107
|
|
|
return $this->banner !== null ? $this->banner->getWebPath() : null; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
|
111
|
|
|
|
112
|
|
|
|
113
|
|
|
|
114
|
|
|
|
115
|
|
|
|
116
|
|
|
//===== GENERATED AUTOMATICALLY =====// |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Set fullName |
120
|
|
|
* |
121
|
|
|
* @param string $fullName |
122
|
|
|
* @return Club |
123
|
|
|
*/ |
124
|
|
|
public function setFullName($fullName) |
125
|
|
|
{ |
126
|
|
|
$this->fullName = $fullName; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Get fullName |
133
|
|
|
* |
134
|
|
|
* @return string |
135
|
|
|
*/ |
136
|
|
|
public function getFullName() |
137
|
|
|
{ |
138
|
|
|
return $this->fullName; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Set icon |
143
|
|
|
* |
144
|
|
|
* @param string $icon |
145
|
|
|
* @return Club |
146
|
|
|
*/ |
147
|
|
|
public function setIcon($icon) |
148
|
|
|
{ |
149
|
|
|
$this->icon = $icon; |
150
|
|
|
|
151
|
|
|
return $this; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* Get icon |
156
|
|
|
* |
157
|
|
|
* @return string |
158
|
|
|
*/ |
159
|
|
|
public function getIcon() |
160
|
|
|
{ |
161
|
|
|
return $this->icon; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* Set presentation |
166
|
|
|
* |
167
|
|
|
* @param text $presentation |
168
|
|
|
* @return Club |
169
|
|
|
*/ |
170
|
|
|
public function setPresentation($presentation) |
171
|
|
|
{ |
172
|
|
|
$this->presentation = $presentation; |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Get presentation |
179
|
|
|
* |
180
|
|
|
* @return text |
181
|
|
|
*/ |
182
|
|
|
public function getPresentation() |
183
|
|
|
{ |
184
|
|
|
return $this->presentation; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* Set active |
189
|
|
|
* |
190
|
|
|
* @param boolean $active |
191
|
|
|
* @return Club |
192
|
|
|
*/ |
193
|
|
|
public function setActive($active) |
194
|
|
|
{ |
195
|
|
|
$this->active = $active; |
196
|
|
|
|
197
|
|
|
return $this; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Get active |
202
|
|
|
* |
203
|
|
|
* @return boolean |
204
|
|
|
*/ |
205
|
|
|
public function getActive() |
206
|
|
|
{ |
207
|
|
|
return $this->active; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* Set category |
212
|
|
|
* |
213
|
|
|
* @param boolean $category |
214
|
|
|
* @return Club |
215
|
|
|
*/ |
216
|
|
|
public function setCategory($category) |
217
|
|
|
{ |
218
|
|
|
$this->category = $category; |
219
|
|
|
|
220
|
|
|
return $this; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* Get category |
225
|
|
|
* |
226
|
|
|
* @return string |
227
|
|
|
*/ |
228
|
|
|
public function getCategory() |
229
|
|
|
{ |
230
|
|
|
return $this->category; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* Get administration |
235
|
|
|
* |
236
|
|
|
* @return boolean |
237
|
|
|
*/ |
238
|
|
|
public function getAdministration() |
239
|
|
|
{ |
240
|
|
|
return $this->administration; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* Set administration |
245
|
|
|
* |
246
|
|
|
* @param boolean $administration |
247
|
|
|
* @return Club |
248
|
|
|
*/ |
249
|
|
|
public function setAdministration($administration) |
250
|
|
|
{ |
251
|
|
|
$this->administration = $administration; |
252
|
|
|
|
253
|
|
|
return $this; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* Set image |
258
|
|
|
* |
259
|
|
|
* @param \KI\CoreBundle\Entity\Image $image |
260
|
|
|
* @return Club |
261
|
|
|
*/ |
262
|
|
|
public function setImage(\KI\CoreBundle\Entity\Image $image = null) |
263
|
|
|
{ |
264
|
|
|
$this->image = $image; |
265
|
|
|
|
266
|
|
|
return $this; |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* Get image |
271
|
|
|
* |
272
|
|
|
* @return \KI\CoreBundle\Entity\Image |
273
|
|
|
*/ |
274
|
|
|
public function getImage() |
275
|
|
|
{ |
276
|
|
|
return $this->image; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* Set banner |
281
|
|
|
* |
282
|
|
|
* @param \KI\CoreBundle\Entity\Image $banner |
283
|
|
|
* @return Club |
284
|
|
|
*/ |
285
|
|
|
public function setBanner(\KI\CoreBundle\Entity\Image $banner = null) |
286
|
|
|
{ |
287
|
|
|
$this->banner = $banner; |
288
|
|
|
|
289
|
|
|
return $this; |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* Get banner |
294
|
|
|
* |
295
|
|
|
* @return \KI\CoreBundle\Entity\Image |
296
|
|
|
*/ |
297
|
|
|
public function getBanner() |
298
|
|
|
{ |
299
|
|
|
return $this->banner; |
300
|
|
|
} |
301
|
|
|
|
302
|
|
|
/** |
303
|
|
|
* Set place |
304
|
|
|
* |
305
|
|
|
* @param string $place |
306
|
|
|
* |
307
|
|
|
* @return Club |
308
|
|
|
*/ |
309
|
|
|
public function setPlace($place) |
310
|
|
|
{ |
311
|
|
|
$this->place = $place; |
312
|
|
|
|
313
|
|
|
return $this; |
314
|
|
|
} |
315
|
|
|
|
316
|
|
|
/** |
317
|
|
|
* Get place |
318
|
|
|
* |
319
|
|
|
* @return string |
320
|
|
|
*/ |
321
|
|
|
public function getPlace() |
322
|
|
|
{ |
323
|
|
|
return $this->place; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* Set open |
328
|
|
|
* |
329
|
|
|
* @param boolean $open |
330
|
|
|
* |
331
|
|
|
* @return Club |
332
|
|
|
*/ |
333
|
|
|
public function setOpen($open) |
334
|
|
|
{ |
335
|
|
|
$this->open = $open; |
336
|
|
|
|
337
|
|
|
return $this; |
338
|
|
|
} |
339
|
|
|
|
340
|
|
|
/** |
341
|
|
|
* Get open |
342
|
|
|
* |
343
|
|
|
* @return boolean |
344
|
|
|
*/ |
345
|
|
|
public function getOpen() |
346
|
|
|
{ |
347
|
|
|
return $this->open; |
348
|
|
|
} |
349
|
|
|
} |
350
|
|
|
|