1 | <?php |
||
21 | class Image implements ImageInterface |
||
22 | { |
||
23 | use TimestampableTrait; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $id; |
||
29 | |||
30 | /** |
||
31 | * Uploaded file extension. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $fileExtension; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $assetId; |
||
41 | |||
42 | /** |
||
43 | * @var ArticleMediaInterface |
||
44 | */ |
||
45 | protected $media; |
||
46 | |||
47 | /** |
||
48 | * @var int |
||
49 | */ |
||
50 | protected $width; |
||
51 | |||
52 | /** |
||
53 | * @var int |
||
54 | */ |
||
55 | protected $height; |
||
56 | |||
57 | /** |
||
58 | * @var float |
||
59 | */ |
||
60 | protected $length; |
||
61 | |||
62 | /** |
||
63 | * @var ArrayCollection |
||
64 | */ |
||
65 | protected $renditions; |
||
66 | |||
67 | protected $variants = []; |
||
68 | |||
69 | /** |
||
70 | * File constructor. |
||
71 | */ |
||
72 | public function __construct() |
||
77 | |||
78 | /** |
||
79 | * @return ArticleMediaInterface |
||
80 | */ |
||
81 | public function getMedia(): ArticleMediaInterface |
||
85 | |||
86 | /** |
||
87 | * @param ArticleMediaInterface $media |
||
88 | */ |
||
89 | public function setMedia(ArticleMediaInterface $media) |
||
93 | |||
94 | /** |
||
95 | * @param string $id |
||
96 | */ |
||
97 | public function setId($id) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function getId() |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function setFileExtension($extension) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function getFileExtension() |
||
125 | |||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getAssetId(): string |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function setAssetId(string $assetId) |
||
141 | |||
142 | /** |
||
143 | * @return ArrayCollection |
||
144 | */ |
||
145 | public function getRenditions() |
||
149 | |||
150 | /** |
||
151 | * @param ImageRendition $rendition |
||
152 | */ |
||
153 | public function addRendition(ImageRendition $rendition) |
||
157 | |||
158 | /** |
||
159 | * @param ArrayCollection $renditions |
||
160 | */ |
||
161 | public function setRenditions($renditions) |
||
165 | |||
166 | public function getWidth(): int |
||
170 | |||
171 | public function setWidth(int $width): void |
||
175 | |||
176 | public function getHeight(): int |
||
180 | |||
181 | public function setHeight(int $height): void |
||
185 | |||
186 | public function getLength(): float |
||
190 | |||
191 | public function setLength(float $length): void |
||
195 | |||
196 | public function getVariants(): array |
||
200 | |||
201 | public function setVariants(array $variants): void |
||
205 | |||
206 | public function addVariant(string $variant): void |
||
212 | |||
213 | public function hasVariant(string $variant): bool |
||
217 | } |
||
218 |