Skip to content

Commit

Permalink
Adding Certifications API in the Api namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 9, 2014
1 parent 0bc00e1 commit c5129cd
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
21 changes: 21 additions & 0 deletions examples/certifications/api/get.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);
31 changes: 31 additions & 0 deletions lib/Tmdb/Api/Certifications.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);
}
}
9 changes: 8 additions & 1 deletion lib/Tmdb/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ public function getNetworksApi()
return new Api\Networks($this);
}


/**
* @return Api\Credits
*/
Expand All @@ -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
*/
Expand Down

0 comments on commit c5129cd

Please sign in to comment.