diff --git a/tmdb-api.php b/tmdb-api.php index ad13da1..ec2c5f7 100644 --- a/tmdb-api.php +++ b/tmdb-api.php @@ -1,5 +1,4 @@ _call('discover/movie', '&page='. $page."&year=".$year); + + foreach($result['results'] as $data){ + $movies[] = new Movie($data); + } + + return $movies; + } + public function searchTVShowsByYear($year,$page = 1) { + + $tvShows = array(); + + $result = $this->_call('discover/tv', '&page='. $page."&first_air_date_year=".$year); + + foreach($result['results'] as $data){ + $tvShows[] = new TVShow($data); + } + + return $tvShows; + } + } ?>