1 | <?php |
||
12 | class TmdbNormalizerService |
||
13 | { |
||
14 | private $movieManageService; |
||
15 | private $genreRepository; |
||
16 | private const IMAGE_HOST = 'https://image.tmdb.org/t/p/original'; |
||
17 | |||
18 | 2 | public function __construct(MovieManageService $movieManageService, GenreRepository $genreRepository) |
|
23 | |||
24 | /** |
||
25 | * @param array $movies |
||
26 | * @param string $locale |
||
27 | * @throws \Exception |
||
28 | * @return Movie[] |
||
29 | */ |
||
30 | 1 | public function normalizeMoviesToObjects(array $movies, string $locale = 'en'): array |
|
48 | |||
49 | /** |
||
50 | * @param array $movie |
||
51 | * @return MovieDTO |
||
52 | * @throws \Exception |
||
53 | */ |
||
54 | 1 | private function createMovieDTO(array $movie): MovieDTO |
|
65 | |||
66 | 1 | private function createMovieTranslation(string $locale, array $movie) |
|
70 | |||
71 | 1 | private function addGenres(Movie $movie, array $tmdbGenresIds): Movie |
|
80 | |||
81 | 1 | private function getMovieLocale(array $movie, string $defaultLocale) |
|
85 | } |