1 | <?php |
||
13 | class TmdbSearchService |
||
14 | { |
||
15 | private $apiKey; |
||
16 | private $client; |
||
17 | private $logger; |
||
18 | private const ApiUrl = 'https://api.themoviedb.org/3'; |
||
19 | |||
20 | 7 | public function __construct(LoggerInterface $logger, ClientInterface $client) |
|
26 | |||
27 | /** |
||
28 | * @param string $query |
||
29 | * @param string $locale |
||
30 | * @param array $data |
||
31 | * |
||
32 | * @throws TmdbMovieNotFoundException |
||
33 | * @throws TmdbRequestLimitException |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | 1 | public function findMoviesByQuery(string $query, string $locale = 'en', $data = []): array |
|
51 | |||
52 | /** |
||
53 | * @param int $tmdb_id |
||
54 | * @param string $locale |
||
55 | * |
||
56 | * @throws TmdbMovieNotFoundException |
||
57 | * @throws TmdbRequestLimitException |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | 1 | public function findMovieById(int $tmdb_id, string $locale = 'en'): array |
|
72 | |||
73 | /** |
||
74 | * @param int $tmdb_id |
||
75 | * |
||
76 | * @throws TmdbMovieNotFoundException |
||
77 | * @throws TmdbRequestLimitException |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | public function findMovieTranslationsById(int $tmdb_id): array |
||
91 | |||
92 | 2 | private function request(string $url, string $method = 'GET', array $params = []): array |
|
127 | } |
||
128 |