1 | <?php |
||
9 | class Media |
||
10 | { |
||
11 | |||
12 | protected $tmdb = null; |
||
13 | protected $conf = null; |
||
14 | protected $logger = null; |
||
15 | |||
16 | /** |
||
17 | * Constructor |
||
18 | * @param Tmdb $tmdb |
||
19 | */ |
||
20 | 3 | public function __construct(Tmdb $tmdb) |
|
26 | |||
27 | /** |
||
28 | * Get backdrop url |
||
29 | * @param string $path |
||
30 | * @param string $size |
||
31 | * @return string|null |
||
32 | */ |
||
33 | 3 | public function getBackdropUrl(string $path, string $size = 'w780'): string |
|
37 | |||
38 | /** |
||
39 | * Get poster url |
||
40 | * @param string $path |
||
41 | * @param string $size |
||
42 | * @return string |
||
43 | */ |
||
44 | 1 | public function getPosterUrl(string $path, string $size = 'w185'): string |
|
48 | |||
49 | /** |
||
50 | * Get logos url |
||
51 | * @param string $path |
||
52 | * @param string $size |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getlogoUrl(string $path, string $size = 'w92'): string |
|
59 | |||
60 | /** |
||
61 | * Get profile url |
||
62 | * @param string $path |
||
63 | * @param string $size |
||
64 | * @return string |
||
65 | */ |
||
66 | 1 | public function getProfileUrl(string $path, string $size = 'w185'): string |
|
70 | |||
71 | /** |
||
72 | * Get poster url |
||
73 | * @param string $path |
||
74 | * @param string $size |
||
75 | * @return string |
||
76 | */ |
||
77 | 1 | public function getStillUrl(string $path, string $size = 'w185'): string |
|
81 | |||
82 | /** |
||
83 | * Get image url from type and size |
||
84 | * @param string $type |
||
85 | * @param string $size |
||
86 | * @param string $filepath |
||
87 | * @return string |
||
88 | * @throws NotFoundException |
||
89 | * @throws IncorrectParamException |
||
90 | */ |
||
91 | 3 | private function getImage(string $type, string $size, string $filepath): string |
|
104 | } |
||
105 |