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
|
|
|
* @JMS\VirtualProperty() |
81
|
|
|
*/ |
82
|
|
|
public function imageUrl() |
83
|
|
|
{ |
84
|
|
|
return $this->image !== null ? $this->image->getWebPath() : 'uploads/others/default-user.png'; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @JMS\VirtualProperty() |
89
|
|
|
*/ |
90
|
|
|
public function bannerUrl() |
91
|
|
|
{ |
92
|
|
|
return $this->banner !== null ? $this->banner->getWebPath() : null; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
|
96
|
|
|
|
97
|
|
|
|
98
|
|
|
|
99
|
|
|
|
100
|
|
|
|
101
|
|
|
//===== GENERATED AUTOMATICALLY =====// |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Set fullName |
105
|
|
|
* |
106
|
|
|
* @param string $fullName |
107
|
|
|
* @return Club |
108
|
|
|
*/ |
109
|
|
|
public function setFullName($fullName) |
110
|
|
|
{ |
111
|
|
|
$this->fullName = $fullName; |
112
|
|
|
|
113
|
|
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Get fullName |
118
|
|
|
* |
119
|
|
|
* @return string |
120
|
|
|
*/ |
121
|
|
|
public function getFullName() |
122
|
|
|
{ |
123
|
|
|
return $this->fullName; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* Set icon |
128
|
|
|
* |
129
|
|
|
* @param string $icon |
130
|
|
|
* @return Club |
131
|
|
|
*/ |
132
|
|
|
public function setIcon($icon) |
133
|
|
|
{ |
134
|
|
|
$this->icon = $icon; |
135
|
|
|
|
136
|
|
|
return $this; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Get icon |
141
|
|
|
* |
142
|
|
|
* @return string |
143
|
|
|
*/ |
144
|
|
|
public function getIcon() |
145
|
|
|
{ |
146
|
|
|
return $this->icon; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Set presentation |
151
|
|
|
* |
152
|
|
|
* @param text $presentation |
153
|
|
|
* @return Club |
154
|
|
|
*/ |
155
|
|
|
public function setPresentation($presentation) |
156
|
|
|
{ |
157
|
|
|
$this->presentation = $presentation; |
158
|
|
|
|
159
|
|
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Get presentation |
164
|
|
|
* |
165
|
|
|
* @return text |
166
|
|
|
*/ |
167
|
|
|
public function getPresentation() |
168
|
|
|
{ |
169
|
|
|
return $this->presentation; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* Set active |
174
|
|
|
* |
175
|
|
|
* @param boolean $active |
176
|
|
|
* @return Club |
177
|
|
|
*/ |
178
|
|
|
public function setActive($active) |
179
|
|
|
{ |
180
|
|
|
$this->active = $active; |
181
|
|
|
|
182
|
|
|
return $this; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* Get active |
187
|
|
|
* |
188
|
|
|
* @return boolean |
189
|
|
|
*/ |
190
|
|
|
public function getActive() |
191
|
|
|
{ |
192
|
|
|
return $this->active; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* Set category |
197
|
|
|
* |
198
|
|
|
* @param boolean $category |
199
|
|
|
* @return Club |
200
|
|
|
*/ |
201
|
|
|
public function setCategory($category) |
202
|
|
|
{ |
203
|
|
|
$this->category = $category; |
204
|
|
|
|
205
|
|
|
return $this; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Get category |
210
|
|
|
* |
211
|
|
|
* @return string |
212
|
|
|
*/ |
213
|
|
|
public function getCategory() |
214
|
|
|
{ |
215
|
|
|
return $this->category; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* Get administration |
220
|
|
|
* |
221
|
|
|
* @return boolean |
222
|
|
|
*/ |
223
|
|
|
public function getAdministration() |
224
|
|
|
{ |
225
|
|
|
return $this->administration; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* Set administration |
230
|
|
|
* |
231
|
|
|
* @param boolean $administration |
232
|
|
|
* @return Club |
233
|
|
|
*/ |
234
|
|
|
public function setAdministration($administration) |
235
|
|
|
{ |
236
|
|
|
$this->administration = $administration; |
237
|
|
|
|
238
|
|
|
return $this; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* Set image |
243
|
|
|
* |
244
|
|
|
* @param \KI\CoreBundle\Entity\Image $image |
245
|
|
|
* @return Club |
246
|
|
|
*/ |
247
|
|
|
public function setImage(\KI\CoreBundle\Entity\Image $image = null) |
248
|
|
|
{ |
249
|
|
|
$this->image = $image; |
250
|
|
|
|
251
|
|
|
return $this; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* Get image |
256
|
|
|
* |
257
|
|
|
* @return \KI\CoreBundle\Entity\Image |
258
|
|
|
*/ |
259
|
|
|
public function getImage() |
260
|
|
|
{ |
261
|
|
|
return $this->image; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* Set banner |
266
|
|
|
* |
267
|
|
|
* @param \KI\CoreBundle\Entity\Image $banner |
268
|
|
|
* @return Club |
269
|
|
|
*/ |
270
|
|
|
public function setBanner(\KI\CoreBundle\Entity\Image $banner = null) |
271
|
|
|
{ |
272
|
|
|
$this->banner = $banner; |
273
|
|
|
|
274
|
|
|
return $this; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* Get banner |
279
|
|
|
* |
280
|
|
|
* @return \KI\CoreBundle\Entity\Image |
281
|
|
|
*/ |
282
|
|
|
public function getBanner() |
283
|
|
|
{ |
284
|
|
|
return $this->banner; |
285
|
|
|
} |
286
|
|
|
} |
287
|
|
|
|