1 | <?php |
||
14 | class PonthubFile extends Likeable |
||
15 | { |
||
16 | protected $fleurDn = 'fleur.enpc.fr'; |
||
17 | protected $fleurPort = 8080; |
||
18 | |||
19 | /** |
||
20 | * Chemin complet sur Fleur |
||
21 | * @ORM\Column(name="path", type="string") |
||
22 | * @JMS\Expose |
||
23 | * @Assert\Type("string") |
||
24 | */ |
||
25 | protected $path; |
||
26 | |||
27 | public function fileUrl() |
||
31 | |||
32 | /** |
||
33 | * Taille en octets |
||
34 | * @ORM\Column(name="size", type="bigint", nullable=true) |
||
35 | * @JMS\Expose |
||
36 | * @Assert\Type("string") |
||
37 | */ |
||
38 | protected $size; |
||
39 | |||
40 | /** |
||
41 | * Date d'ajout (timestamp) |
||
42 | * @ORM\Column(name="added", type="integer", nullable=true) |
||
43 | * @JMS\Expose |
||
44 | * @Assert\Type("integer") |
||
45 | */ |
||
46 | protected $added; |
||
47 | |||
48 | /** |
||
49 | * Statut [OK|NeedInfos|NotFound] |
||
50 | * @ORM\Column(name="status", type="string") |
||
51 | * @JMS\Expose |
||
52 | * @Assert\Type("string") |
||
53 | */ |
||
54 | protected $status; |
||
55 | |||
56 | /** |
||
57 | * Description |
||
58 | * @ORM\Column(name="description", type="string", nullable=true) |
||
59 | * @JMS\Expose |
||
60 | * @Assert\Type("string") |
||
61 | */ |
||
62 | protected $description; |
||
63 | |||
64 | /** |
||
65 | * Image (affiche/jaquette/screenshot...) |
||
66 | * @ORM\OneToOne(targetEntity="KI\CoreBundle\Entity\Image", cascade={"persist", "remove"}) |
||
67 | * @Assert\Valid() |
||
68 | */ |
||
69 | protected $image; |
||
70 | |||
71 | /** |
||
72 | * @JMS\VirtualProperty() |
||
73 | */ |
||
74 | public function imageUrl() |
||
78 | |||
79 | /** |
||
80 | * Tags |
||
81 | * @ORM\ManyToMany(targetEntity="KI\CoreBundle\Entity\Tag", cascade={"persist"}) |
||
82 | * @Assert\Valid() |
||
83 | */ |
||
84 | protected $listTags; |
||
85 | |||
86 | /** |
||
87 | * @JMS\VirtualProperty() |
||
88 | */ |
||
89 | public function tags() |
||
99 | |||
100 | /** |
||
101 | * Genres |
||
102 | * @ORM\ManyToMany(targetEntity="KI\PonthubBundle\Entity\Genre", cascade={"persist"}) |
||
103 | * @Assert\Valid() |
||
104 | */ |
||
105 | protected $listGenres; |
||
106 | |||
107 | /** |
||
108 | * @JMS\VirtualProperty() |
||
109 | */ |
||
110 | public function genres() |
||
118 | |||
119 | /** |
||
120 | * Utilisateurs ayant téléchargé le fichier |
||
121 | * @ORM\OneToMany(targetEntity="KI\PonthubBundle\Entity\PonthubFileUser", mappedBy="file", cascade={"remove"}) |
||
122 | * @Assert\Valid() |
||
123 | */ |
||
124 | protected $users; |
||
125 | |||
126 | /** |
||
127 | * Nombre de fois où le fichier a été téléchargé |
||
128 | * @JMS\VirtualProperty() |
||
129 | */ |
||
130 | public function downloads() |
||
134 | |||
135 | /** |
||
136 | * Constructor |
||
137 | */ |
||
138 | public function __construct() |
||
144 | |||
145 | /** |
||
146 | * Set size |
||
147 | * |
||
148 | * @param integer $size |
||
149 | * @return PonthubFile |
||
150 | */ |
||
151 | public function setSize($size) |
||
157 | |||
158 | /** |
||
159 | * Get size |
||
160 | * |
||
161 | * @return integer |
||
162 | */ |
||
163 | public function getSize() |
||
167 | |||
168 | /** |
||
169 | * Set path |
||
170 | * |
||
171 | * @param string $path |
||
172 | * @return PonthubFile |
||
173 | */ |
||
174 | public function setPath($path) |
||
180 | |||
181 | /** |
||
182 | * Get path |
||
183 | * |
||
184 | * @return string |
||
185 | */ |
||
186 | public function getPath() |
||
190 | |||
191 | /** |
||
192 | * Set added |
||
193 | * |
||
194 | * @param integer $added |
||
195 | * @return PonthubFile |
||
196 | */ |
||
197 | public function setAdded($added) |
||
203 | |||
204 | /** |
||
205 | * Get added |
||
206 | * |
||
207 | * @return integer |
||
208 | */ |
||
209 | public function getAdded() |
||
213 | |||
214 | /** |
||
215 | * Set status |
||
216 | * |
||
217 | * @param string $status |
||
218 | * @return PonthubFile |
||
219 | */ |
||
220 | public function setStatus($status) |
||
226 | |||
227 | /** |
||
228 | * Get status |
||
229 | * |
||
230 | * @return string |
||
231 | */ |
||
232 | public function getStatus() |
||
236 | |||
237 | /** |
||
238 | * Set description |
||
239 | * |
||
240 | * @param string $description |
||
241 | * @return PonthubFile |
||
242 | */ |
||
243 | public function setDescription($description) |
||
249 | |||
250 | /** |
||
251 | * Get description |
||
252 | * |
||
253 | * @return string |
||
254 | */ |
||
255 | public function getDescription() |
||
259 | |||
260 | /** |
||
261 | * Set image |
||
262 | * |
||
263 | * @param \KI\CoreBundle\Entity\Image $image |
||
264 | * @return PonthubFile |
||
265 | */ |
||
266 | public function setImage(\KI\CoreBundle\Entity\Image $image = null) |
||
272 | |||
273 | /** |
||
274 | * Get image |
||
275 | * |
||
276 | * @return \KI\CoreBundle\Entity\Image |
||
277 | */ |
||
278 | public function getImage() |
||
282 | |||
283 | /** |
||
284 | * Add tags |
||
285 | * |
||
286 | * @param \KI\CoreBundle\Entity\Tag $tag |
||
287 | * @return PonthubFile |
||
288 | */ |
||
289 | public function addTag(\KI\CoreBundle\Entity\Tag $tag) |
||
295 | |||
296 | /** |
||
297 | * Remove tags |
||
298 | * |
||
299 | * @param \KI\CoreBundle\Entity\Tag $tag |
||
300 | */ |
||
301 | public function removeTag(\KI\CoreBundle\Entity\Tag $tag) |
||
305 | |||
306 | /** |
||
307 | * Get tags |
||
308 | * |
||
309 | * @return \Doctrine\Common\Collections\Collection |
||
310 | */ |
||
311 | public function getTags() |
||
315 | |||
316 | /** |
||
317 | * Set tags |
||
318 | * |
||
319 | * @return PonthubFile |
||
320 | */ |
||
321 | public function setTags($tags) |
||
325 | |||
326 | /** |
||
327 | * Add genres |
||
328 | * |
||
329 | * @param \KI\PonthubBundle\Entity\Genre $genre |
||
330 | * @return PonthubFile |
||
331 | */ |
||
332 | public function addGenre(\KI\PonthubBundle\Entity\Genre $genre) |
||
338 | |||
339 | /** |
||
340 | * Remove genres |
||
341 | * |
||
342 | * @param \KI\PonthubBundle\Entity\Genre $genre |
||
343 | */ |
||
344 | public function removeGenre(\KI\PonthubBundle\Entity\Genre $genre) |
||
348 | |||
349 | /** |
||
350 | * Get genres |
||
351 | * |
||
352 | * @return \Doctrine\Common\Collections\Collection |
||
353 | */ |
||
354 | public function getGenres() |
||
358 | |||
359 | /** |
||
360 | * Set genres |
||
361 | * |
||
362 | * @return PonthubFile |
||
363 | */ |
||
364 | public function setGenres($genres) |
||
368 | |||
369 | |||
370 | /** |
||
371 | * Add user |
||
372 | * |
||
373 | * @param \KI\UserBundle\Entity\User $user |
||
374 | * @return PonthubFile |
||
375 | */ |
||
376 | public function addUser(\KI\UserBundle\Entity\User $user) |
||
382 | |||
383 | /** |
||
384 | * Remove users |
||
385 | * |
||
386 | * @param \KI\UserBundle\Entity\User $user |
||
387 | */ |
||
388 | public function removeUser(\KI\UserBundle\Entity\User $user) |
||
392 | |||
393 | /** |
||
394 | * Get users |
||
395 | * |
||
396 | * @return \Doctrine\Common\Collections\Collection |
||
397 | */ |
||
398 | public function getUsers() |
||
402 | |||
403 | /** |
||
404 | * Set users |
||
405 | * |
||
406 | * @return PonthubFile |
||
407 | */ |
||
408 | public function setUsers($users) |
||
412 | |||
413 | /** |
||
414 | * @JMS\Expose |
||
415 | */ |
||
416 | protected $downloaded = false; |
||
417 | |||
418 | public function hasBeenDownloaded() |
||
422 | |||
423 | public function setDownloaded($downloaded) |
||
427 | } |
||
428 |