1 | <?php |
||
15 | class Media |
||
16 | { |
||
17 | use TimestampableEntity; |
||
18 | |||
19 | /** |
||
20 | * @ORM\Id |
||
21 | * @ORM\Column(type="bigint") |
||
22 | * @ORM\GeneratedValue(strategy="AUTO") |
||
23 | */ |
||
24 | protected $id; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | * |
||
29 | * @ORM\Column(type="string", unique=true, length=255) |
||
30 | * @ORM\GeneratedValue(strategy="AUTO") |
||
31 | */ |
||
32 | protected $uuid; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | * |
||
37 | * @ORM\Column(type="string", nullable=true) |
||
38 | */ |
||
39 | protected $name; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | * |
||
44 | * @ORM\Column(type="string", nullable=true, name="original_filename") |
||
45 | */ |
||
46 | protected $originalFilename; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | * |
||
51 | * @ORM\Column(type="string", name="location", nullable=true) |
||
52 | */ |
||
53 | protected $location; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | * |
||
58 | * @ORM\Column(type="string", name="content_type") |
||
59 | */ |
||
60 | protected $contentType; |
||
61 | |||
62 | /** |
||
63 | * @var array |
||
64 | * |
||
65 | * @ORM\Column(type="array") |
||
66 | */ |
||
67 | protected $metadata = []; |
||
68 | |||
69 | /** |
||
70 | * @var Folder |
||
71 | * |
||
72 | * @ORM\ManyToOne(targetEntity="Folder", inversedBy="media") |
||
73 | * @ORM\JoinColumn(name="folder_id", referencedColumnName="id") |
||
74 | */ |
||
75 | protected $folder; |
||
76 | |||
77 | /** |
||
78 | * @var mixed |
||
79 | */ |
||
80 | protected $content; |
||
81 | |||
82 | /** |
||
83 | * @var int |
||
84 | * |
||
85 | * @ORM\Column(type="integer", nullable=true) |
||
86 | */ |
||
87 | protected $filesize; |
||
88 | |||
89 | /** |
||
90 | * @var string |
||
91 | * |
||
92 | * @ORM\Column(type="string", nullable=true) |
||
93 | */ |
||
94 | protected $url; |
||
95 | |||
96 | /** |
||
97 | * @var bool |
||
98 | * |
||
99 | * @ORM\Column(type="boolean") |
||
100 | */ |
||
101 | protected $deleted; |
||
102 | |||
103 | /** |
||
104 | * constructor. |
||
105 | */ |
||
106 | public function __construct() |
||
112 | |||
113 | /** |
||
114 | * Return string representation of entity; we return the url display directly the media without using any getter. |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | public function __toString() |
||
122 | |||
123 | /** |
||
124 | * Get id. |
||
125 | * |
||
126 | * @return int |
||
127 | */ |
||
128 | public function getId() |
||
132 | |||
133 | /** |
||
134 | * Set id. |
||
135 | * |
||
136 | * @param int $id The unique identifier |
||
137 | */ |
||
138 | public function setId($id) |
||
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | public function getFileSize() |
||
160 | |||
161 | /** |
||
162 | * @param int $filesize |
||
163 | */ |
||
164 | public function setFileSize($filesize) |
||
168 | |||
169 | /** |
||
170 | * Set uuid. |
||
171 | * |
||
172 | * @param string $uuid |
||
173 | */ |
||
174 | public function setUuid($uuid) |
||
178 | |||
179 | /** |
||
180 | * Get uuid. |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | public function getUuid() |
||
188 | |||
189 | /** |
||
190 | * Set name. |
||
191 | * |
||
192 | * @param string $name |
||
193 | */ |
||
194 | public function setName($name) |
||
198 | |||
199 | /** |
||
200 | * Get name. |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | public function getName() |
||
208 | |||
209 | /** |
||
210 | * @param string $originalFilename |
||
211 | * |
||
212 | * @return Media |
||
213 | */ |
||
214 | public function setOriginalFilename($originalFilename) |
||
220 | |||
221 | /** |
||
222 | * @return string |
||
223 | */ |
||
224 | public function getOriginalFilename() |
||
228 | |||
229 | /** |
||
230 | * Set location. |
||
231 | * |
||
232 | * @param string $location |
||
233 | */ |
||
234 | public function setLocation($location) |
||
238 | |||
239 | /** |
||
240 | * Get location. |
||
241 | * |
||
242 | * @return string |
||
243 | */ |
||
244 | public function getLocation() |
||
248 | |||
249 | /** |
||
250 | * Set contentType. |
||
251 | * |
||
252 | * @param string $contentType |
||
253 | */ |
||
254 | public function setContentType($contentType) |
||
258 | |||
259 | /** |
||
260 | * Get contentType. |
||
261 | * |
||
262 | * @return string |
||
263 | */ |
||
264 | public function getContentType() |
||
268 | |||
269 | /** |
||
270 | * Get contentType. |
||
271 | * |
||
272 | * @return string |
||
273 | */ |
||
274 | public function getContentTypeShort() |
||
282 | |||
283 | /** |
||
284 | * Set metadata. |
||
285 | * |
||
286 | * @param array $metadata |
||
287 | * |
||
288 | * @return Media |
||
289 | */ |
||
290 | public function setMetadata($metadata) |
||
296 | |||
297 | /** |
||
298 | * Get metadata. |
||
299 | * |
||
300 | * @return array |
||
301 | */ |
||
302 | public function getMetadata() |
||
306 | |||
307 | /** |
||
308 | * Set the specified metadata value. |
||
309 | * |
||
310 | * @param string $key |
||
311 | * @param mixed $value |
||
312 | * |
||
313 | * @return Media |
||
314 | */ |
||
315 | public function setMetadataValue($key, $value) |
||
321 | |||
322 | /** |
||
323 | * Get the specified metadata value. |
||
324 | * |
||
325 | * @param string $key |
||
326 | * |
||
327 | * @return mixed|null |
||
328 | */ |
||
329 | public function getMetadataValue($key) |
||
333 | |||
334 | /** |
||
335 | * Set content. |
||
336 | * |
||
337 | * @param mixed $content |
||
338 | * |
||
339 | * @return Media |
||
340 | */ |
||
341 | public function setContent($content) |
||
348 | |||
349 | /** |
||
350 | * Get content. |
||
351 | * |
||
352 | * @return mixed |
||
353 | */ |
||
354 | public function getContent() |
||
358 | |||
359 | /** |
||
360 | * Set folder. |
||
361 | * |
||
362 | * @param Folder $folder |
||
363 | * |
||
364 | * @return Media |
||
365 | */ |
||
366 | public function setFolder($folder) |
||
372 | |||
373 | /** |
||
374 | * Get folder. |
||
375 | * |
||
376 | * @return Folder |
||
377 | */ |
||
378 | public function getFolder() |
||
382 | |||
383 | /** |
||
384 | * @return bool |
||
385 | */ |
||
386 | public function isDeleted() |
||
390 | |||
391 | /** |
||
392 | * @param bool $deleted |
||
393 | */ |
||
394 | public function setDeleted($deleted) |
||
398 | |||
399 | /** |
||
400 | * @return int |
||
401 | */ |
||
402 | public function getDeleted() |
||
406 | |||
407 | /** |
||
408 | * @return string |
||
409 | */ |
||
410 | public function getUrl() |
||
414 | |||
415 | /** |
||
416 | * @param string $url |
||
417 | */ |
||
418 | public function setUrl($url) |
||
422 | |||
423 | /** |
||
424 | * @return string |
||
425 | */ |
||
426 | public function getClassType() |
||
433 | |||
434 | /** |
||
435 | * @ORM\PrePersist |
||
436 | */ |
||
437 | public function prePersist() |
||
443 | } |
||
444 |