From c5129cd87a083266d150bdedb011631d16acc2ae Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sun, 9 Feb 2014 01:29:03 +0100 Subject: [PATCH] Adding Certifications API in the Api namespace. --- examples/certifications/api/get.php | 21 +++++++++++++++++++ lib/Tmdb/Api/Certifications.php | 31 +++++++++++++++++++++++++++++ lib/Tmdb/Client.php | 9 ++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 examples/certifications/api/get.php create mode 100644 lib/Tmdb/Api/Certifications.php diff --git a/examples/certifications/api/get.php b/examples/certifications/api/get.php new file mode 100644 index 00000000..96d01c0e --- /dev/null +++ b/examples/certifications/api/get.php @@ -0,0 +1,21 @@ + + * @copyright (c) 2013, Michael Roterman + * @version 0.0.1 + */ +require_once('../../../vendor/autoload.php'); +require_once('../../../apikey.php'); + +$token = new \Tmdb\ApiToken(TMDB_API_KEY); +$client = new \Tmdb\Client($token); + +$credit = $client->getCertificationsApi()->getMovieList(); + +var_dump($credit); \ No newline at end of file diff --git a/lib/Tmdb/Api/Certifications.php b/lib/Tmdb/Api/Certifications.php new file mode 100644 index 00000000..e22742d9 --- /dev/null +++ b/lib/Tmdb/Api/Certifications.php @@ -0,0 +1,31 @@ + + * @copyright (c) 2013, Michael Roterman + * @version 0.0.1 + */ +namespace Tmdb\Api; + +class Certifications + extends AbstractApi +{ + /** + * Get the list of supported certifications for movies. + * + * These can be used in conjunction with the certification_country and certification.lte parameters when using discover. + * + * @param array $parameters + * @param array $headers + * @return mixed + */ + public function getMovieList(array $parameters = array(), array $headers = array()) + { + return $this->get('certification/movie/list', $parameters, $headers); + } +} diff --git a/lib/Tmdb/Client.php b/lib/Tmdb/Client.php index 48a02137..c1900373 100644 --- a/lib/Tmdb/Client.php +++ b/lib/Tmdb/Client.php @@ -259,7 +259,6 @@ public function getNetworksApi() return new Api\Networks($this); } - /** * @return Api\Credits */ @@ -268,6 +267,14 @@ public function getCreditsApi() return new Api\Credits($this); } + /** + * @return Api\Certifications + */ + public function getCertificationsApi() + { + return new Api\Certifications($this); + } + /** * @return HttpClientInterface */