1 | <?php |
||
2 | |||
3 | namespace Osnova\Services\Media; |
||
4 | |||
5 | class Image extends Media |
||
6 | { |
||
7 | /** |
||
8 | * Determines whether the media has an audio. |
||
9 | * |
||
10 | * @return bool |
||
11 | */ |
||
12 | public function hasAudio() |
||
13 | { |
||
14 | return $this->getData('additionalData.hasAudio') === true; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Get image type. |
||
19 | * |
||
20 | * @return string|null |
||
21 | */ |
||
22 | public function getImageType() |
||
23 | { |
||
24 | return $this->getData('additionalData.type'); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Get image URL. |
||
29 | * |
||
30 | * @return string|null |
||
31 | */ |
||
32 | public function getUrl() |
||
33 | { |
||
34 | return $this->getData('imageUrl'); |
||
0 ignored issues
–
show
|
|||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get image width. |
||
39 | * |
||
40 | * @return int|null |
||
41 | */ |
||
42 | public function getWidth() |
||
43 | { |
||
44 | return $this->getData('size.width'); |
||
0 ignored issues
–
show
|
|||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Get image height. |
||
49 | * |
||
50 | * @return int|null |
||
51 | */ |
||
52 | public function getHeight() |
||
53 | { |
||
54 | return $this->getData('size.height'); |
||
0 ignored issues
–
show
|
|||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Get image aspect ratio. |
||
59 | * |
||
60 | * @return int|null |
||
61 | */ |
||
62 | public function getRatio() |
||
63 | { |
||
64 | return $this->getData('size.ratio', 0); |
||
0 ignored issues
–
show
|
|||
65 | } |
||
66 | } |
||
67 |