1 | <?php |
||
5 | abstract class Element |
||
6 | { |
||
7 | protected $data = null; |
||
8 | protected $conf = null; |
||
9 | |||
10 | /** |
||
11 | * Get item poster |
||
12 | * @param string $size |
||
13 | * @return string |
||
14 | */ |
||
15 | 21 | public function getPoster(string $size = 'w185'): string |
|
19 | |||
20 | /** |
||
21 | * Get item backdrop |
||
22 | * @param string $size |
||
23 | * @return string|null |
||
24 | */ |
||
25 | 21 | public function getBackdrop(string $size = 'w780'): string |
|
29 | |||
30 | /** |
||
31 | * Get poster path |
||
32 | */ |
||
33 | 6 | public function getPosterPath(): string |
|
41 | |||
42 | /** |
||
43 | * Get backdrop |
||
44 | */ |
||
45 | 6 | public function getBackdropPath(): string |
|
53 | |||
54 | /** |
||
55 | * Get image url from type and size |
||
56 | * @param string $type |
||
57 | * @param string $size |
||
58 | * @return string |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | 42 | private function getImage(string $type, string $size): string |
|
79 | |||
80 | } |
||
81 |