some progress
This commit is contained in:
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\TMDBApi;
|
||||
|
||||
class MoviesApi extends AbstractApiService
|
||||
{
|
||||
/**
|
||||
* Get the basic movie information for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMovie($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId, $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the alternative titles for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAlternativeTitles($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/alternative_titles', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cast and crew information for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCredits($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/credits', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the images (posters and backdrops) for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getImages($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/images', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plot keywords for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getKeywords($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/keywords', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the release date by country for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReleases($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/releases', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the trailers for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
* @deprecated TMDB changed the way of requesting trailers, see getVideos instead!
|
||||
*/
|
||||
public function getTrailers($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/trailers', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the translations for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTranslations($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/translations', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the similar movies for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSimilar($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/similar', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the recommended movies for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRecommendations($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/recommendations', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reviews for a particular movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReviews($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/reviews', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the lists that the movie belongs to.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLists($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/lists', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the changes for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getChanges($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/changes', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest movie id.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLatest(array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/latest', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of upcoming movies. This list refreshes every day.
|
||||
* The maximum number of items this list will include is 100.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUpcoming(array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/upcoming', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of movies playing in theatres. This list refreshes every day.
|
||||
* The maximum number of items this list will include is 100.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNowPlaying(array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/now_playing', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of popular movies on The Movie Database.
|
||||
* This list refreshes every day.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPopular(array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/popular', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of top rated movies. By default, this list will only include
|
||||
* movies that have 10 or more votes. This list refreshes every day.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTopRated(array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/top_rated', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the videos (trailers, teasers, clips, etc...) for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getVideos($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/videos', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the watch providers (by region) for a specific movie id.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getWatchProviders($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/watch/providers', $parameters, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the external ids that we have stored for a movie.
|
||||
*
|
||||
* @param $movieId
|
||||
* @param array $parameters
|
||||
* @param array $headers
|
||||
* @return mixed
|
||||
*/
|
||||
public function getExternalIds($movieId, array $parameters = [], array $headers = [])
|
||||
{
|
||||
sleep(1);
|
||||
return $this->get('movie/' . $movieId . '/external_ids', $parameters, $headers);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user