Total Complexity | 6 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
16 | trait FileTrait |
||
17 | { |
||
18 | /** |
||
19 | * We are not asserting this is a file here because it may be a string for dynamic component e.g. {{ filePath }} |
||
20 | * validation constraint could be made perhaps to validate a file or a variable |
||
21 | * @ORM\Column(type="string", nullable=false) |
||
22 | * @Groups({"default"}) |
||
23 | * @ApiProperty(iri="http://schema.org/contentUrl") |
||
24 | * @var null|string |
||
25 | */ |
||
26 | protected $filePath; |
||
27 | |||
28 | /** |
||
29 | * @Groups({"default"}) |
||
30 | * @var FileData|null |
||
31 | */ |
||
32 | private $fileData; |
||
33 | |||
34 | /** |
||
35 | * @return null|string |
||
36 | */ |
||
37 | public function getFilePath(): ?string |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param null|string $filePath |
||
44 | * @return static |
||
45 | */ |
||
46 | public function setFilePath(?string $filePath) |
||
47 | { |
||
48 | $this->filePath = $filePath; |
||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | public static function getImagineFilters(): array |
||
58 | ]; |
||
59 | } |
||
60 | |||
61 | public function getDir(): ?string |
||
62 | { |
||
63 | return null; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @return null|FileData |
||
68 | */ |
||
69 | public function getFileData(): ?FileData |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @param null|FileData $fileData |
||
76 | * @return static |
||
77 | */ |
||
78 | public function setFileData(?FileData $fileData) |
||
82 | } |
||
83 | } |
||
84 |