diff --git a/lib/Tmdb/Api/Changes.php b/lib/Tmdb/Api/Changes.php index 55026fcc..0045cd30 100644 --- a/lib/Tmdb/Api/Changes.php +++ b/lib/Tmdb/Api/Changes.php @@ -50,7 +50,7 @@ public function getMovieChanges(array $options = array(), array $headers = array * @param array $headers * @return mixed */ - public function getPeopleChanges(array $options = array(), array $headers = array()) + public function getPersonChanges(array $options = array(), array $headers = array()) { return $this->get('person/changes', $options, $headers); } diff --git a/lib/Tmdb/Api/Genres.php b/lib/Tmdb/Api/Genres.php index 80589024..b6e9a6bf 100644 --- a/lib/Tmdb/Api/Genres.php +++ b/lib/Tmdb/Api/Genres.php @@ -27,9 +27,11 @@ public function getGenre($id, array $options = array(), array $headers = array() { $response = $this->getGenres(); - foreach($response['genres'] as $genre) { - if ($id == $genre['id']) { - return $genre; + if (array_key_exists('genres', $response)) { + foreach($response['genres'] as $genre) { + if ($id == $genre['id']) { + return $genre; + } } } diff --git a/lib/Tmdb/Api/Jobs.php b/lib/Tmdb/Api/Jobs.php index d778d28c..b92a065d 100644 --- a/lib/Tmdb/Api/Jobs.php +++ b/lib/Tmdb/Api/Jobs.php @@ -22,7 +22,7 @@ class Jobs * @param array $headers * @return mixed */ - public function getMovieChanges(array $options = array(), array $headers = array()) + public function getJobs(array $options = array(), array $headers = array()) { return $this->get('job/list', $options, $headers); } diff --git a/lib/Tmdb/Api/Keywords.php b/lib/Tmdb/Api/Keywords.php index f08f0921..43b6a01f 100644 --- a/lib/Tmdb/Api/Keywords.php +++ b/lib/Tmdb/Api/Keywords.php @@ -18,19 +18,20 @@ class Keywords /** * Get the basic information for a specific keyword id. * + * @param int $keyword_id * @param array $options * @param array $headers * @return mixed */ - public function getKeywords(array $options = array(), array $headers = array()) + public function getKeyword($keyword_id, array $options = array(), array $headers = array()) { - return $this->get('keyword/list', $options, $headers); + return $this->get('keyword/' . $keyword_id, $options, $headers); } /** * Get the list of movies for a particular keyword by id. * - * @param $keyword_id + * @param int $keyword_id * @param array $options * @param array $headers * @return mixed diff --git a/lib/Tmdb/Api/Search.php b/lib/Tmdb/Api/Search.php index f79ff994..5764c23a 100644 --- a/lib/Tmdb/Api/Search.php +++ b/lib/Tmdb/Api/Search.php @@ -26,7 +26,7 @@ class Search public function searchMovies($query, array $options = array(), array $headers = array()) { return $this->get('search/movie', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -41,7 +41,7 @@ public function searchMovies($query, array $options = array(), array $headers = public function searchCollection($query, array $options = array(), array $headers = array()) { return $this->get('search/collection', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -56,7 +56,7 @@ public function searchCollection($query, array $options = array(), array $header public function searchTv($query, array $options = array(), array $headers = array()) { return $this->get('search/tv', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -71,7 +71,7 @@ public function searchTv($query, array $options = array(), array $headers = arra public function searchPersons($query, array $options = array(), array $headers = array()) { return $this->get('search/person', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -86,7 +86,7 @@ public function searchPersons($query, array $options = array(), array $headers = public function searchList($query, array $options = array(), array $headers = array()) { return $this->get('search/list', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -101,7 +101,7 @@ public function searchList($query, array $options = array(), array $headers = ar public function searchCompany($query, array $options = array(), array $headers = array()) { return $this->get('search/company', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } @@ -116,7 +116,7 @@ public function searchCompany($query, array $options = array(), array $headers = public function searchKeyword($query, array $options = array(), array $headers = array()) { return $this->get('search/keyword', array_merge($options, array( - 'query' => $query + 'query' => urlencode($query) ), $headers)); } } \ No newline at end of file diff --git a/lib/Tmdb/Api/Tv.php b/lib/Tmdb/Api/Tv.php index d0d10eb9..e48dc594 100644 --- a/lib/Tmdb/Api/Tv.php +++ b/lib/Tmdb/Api/Tv.php @@ -50,7 +50,7 @@ public function getCredits($tvshow_id, array $options = array(), array $headers * @param array $headers * @return mixed */ - public function getCast($tvshow_id, array $options = array(), array $headers = array()) + public function getExternalIds($tvshow_id, array $options = array(), array $headers = array()) { return $this->get('tv/' . $tvshow_id . '/external_ids', $options, $headers); } diff --git a/lib/Tmdb/Api/TvSeason.php b/lib/Tmdb/Api/TvSeason.php index 1fc53fcc..8b1666e4 100644 --- a/lib/Tmdb/Api/TvSeason.php +++ b/lib/Tmdb/Api/TvSeason.php @@ -29,6 +29,20 @@ public function getSeason($tvshow_id, $season_number, array $options = array(), return $this->get(sprintf('tv/%s/season/%s', $tvshow_id, $season_number), $options, $headers); } + /** + * Get the cast & crew credits for a TV season by season number. + * + * @param $tvshow_id + * @param $season_number + * @param array $options + * @param array $headers + * @return mixed + */ + public function getSeasonCredits($tvshow_id, $season_number, array $options = array(), array $headers = array()) + { + return $this->get(sprintf('tv/%s/season/%s/credits', $tvshow_id, $season_number), $options, $headers); + } + /** * Get the external ids that we have stored for a TV season by season number. * @@ -42,4 +56,18 @@ public function getSeasonExternalIds($tvshow_id, $season_number, array $options { return $this->get(sprintf('tv/%s/season/%s/external_ids', $tvshow_id, $season_number), $options, $headers); } + + /** + * Get the images (posters) that we have stored for a TV season by season number. + * + * @param $tvshow_id + * @param $season_number + * @param array $options + * @param array $headers + * @return mixed + */ + public function getSeasonImages($tvshow_id, $season_number, array $options = array(), array $headers = array()) + { + return $this->get(sprintf('tv/%s/season/%s/images', $tvshow_id, $season_number), $options, $headers); + } } \ No newline at end of file