Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
t message to explain why this merge is necessary,
  • Loading branch information
wtfzdotnet committed Jul 9, 2014
2 parents d7764d4 + f2ee218 commit 63812a5
Show file tree
Hide file tree
Showing 56 changed files with 910 additions and 54 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"require": {
"php": ">=5.3.2",
"ext-curl": "*",
"guzzle/guzzle": "3.8.*",
"guzzle/guzzle": "3.9.*",
"psr/log": "~1.0"
},
"require-dev": {
Expand Down
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions examples/account/model/favorite_tv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

/**
* @var \Tmdb\Repository\AccountRepository $accountRepository
*/
$accountRepository = new \Tmdb\Repository\AccountRepository($client);
$lists = $accountRepository->getFavoriteTvShows(TMDB_ACCOUNT_ID);

var_dump($lists);
28 changes: 28 additions & 0 deletions examples/account/model/favorite_tv_add.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

/**
* @var \Tmdb\Repository\AccountRepository $accountRepository
*/
$accountRepository = new \Tmdb\Repository\AccountRepository($client);
$lists = $accountRepository->favorite(TMDB_ACCOUNT_ID, 1973, true, 'tv');

var_dump($lists);
28 changes: 28 additions & 0 deletions examples/account/model/rated_tv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

/**
* @var \Tmdb\Repository\AccountRepository $accountRepository
*/
$accountRepository = new \Tmdb\Repository\AccountRepository($client);
$lists = $accountRepository->getRatedTvShows(TMDB_ACCOUNT_ID);

var_dump($lists);
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions examples/account/model/watchlist_tv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

/**
* @var \Tmdb\Repository\AccountRepository $accountRepository
*/
$accountRepository = new \Tmdb\Repository\AccountRepository($client);
$lists = $accountRepository->getTvWatchlist(TMDB_ACCOUNT_ID);

var_dump($lists);
28 changes: 28 additions & 0 deletions examples/account/model/watchlist_tv_add.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

/**
* @var \Tmdb\Repository\AccountRepository $accountRepository
*/
$accountRepository = new \Tmdb\Repository\AccountRepository($client);
$lists = $accountRepository->watchlist(TMDB_ACCOUNT_ID, 1973, true, 'tv');

var_dump($lists);
6 changes: 3 additions & 3 deletions examples/changes/api/movies.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
$client = new \Tmdb\Client($token);

$movieChanges = $client->getChangesApi()->getMovieChanges(array(
'page' => 1,
'from' => '01-01-2012',
'to' => '08-01-2012'
'page' => 1,
'start_date' => '2014-01-01',
'end_date' => '2014-01-02'
));

var_dump($movieChanges);
6 changes: 3 additions & 3 deletions examples/changes/api/people.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
$client = new \Tmdb\Client($token);

$personChanges = $client->getChangesApi()->getPersonChanges(array(
'page' => 1,
'from' => '01-01-2012',
'to' => '08-01-2012'
'page' => 1,
'start_date' => '2014-01-14',
'end_date' => '2014-01-21'
));

var_dump($personChanges);
4 changes: 2 additions & 2 deletions examples/changes/model/movies.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

$query = new \Tmdb\Model\Query\ChangesQuery();

$from = new \DateTime('01-01-2012');
$to = new \DateTime('08-01-2012');
$from = new \DateTime('01-01-2014');
$to = new \DateTime('02-01-2014');

$query
->page(1)
Expand Down
4 changes: 2 additions & 2 deletions examples/changes/model/people.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

$query = new \Tmdb\Model\Query\ChangesQuery();

$from = new \DateTime('01-01-2012');
$to = new \DateTime('08-01-2012');
$from = new \DateTime('14-01-2014');
$to = new \DateTime('21-01-2014');

$query
->page(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

$similarMovies = $client->getMoviesApi()->getSimilarMovies(87421);
$similarMovies = $client->getMoviesApi()->getSimilar(87421);

var_dump($similarMovies);
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
$client = new \Tmdb\Client($token);

$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getSimilarMovies(87421);
$collection = $repository->getSimilar(87421);

var_dump($collection);
21 changes: 21 additions & 0 deletions examples/people/api/tagged_images.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);

$taggedImages = $client->getPeopleApi()->getTaggedImages(287);

var_dump($taggedImages);
22 changes: 22 additions & 0 deletions examples/people/model/tagged_images.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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);

$repository = new \Tmdb\Repository\PeopleRepository($client);
$person = $repository->getTaggedImages(287);

var_dump($person);
21 changes: 21 additions & 0 deletions examples/tv/api/tv/latest.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);

$tvShow = $client->getTvApi()->getLatest();

var_dump($tvShow);
22 changes: 22 additions & 0 deletions examples/tv/model/tv/latest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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);

$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getLatest();

var_dump($tvShow);
17 changes: 16 additions & 1 deletion lib/Tmdb/Api/Movies.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,25 @@ public function getTranslations($movie_id, array $parameters = array(), array $h
* @param array $parameters
* @param array $headers
* @return mixed
*
* @deprecated Will be removed in one of the upcoming versions, has been updated to getSimilar ( following TMDB ).
*/
public function getSimilarMovies($movie_id, array $parameters = array(), array $headers = array())
{
return $this->get('movie/' . $movie_id . '/similar_movies', $parameters, $headers);
return $this->getSimilar($movie_id, $parameters, $headers);
}

/**
* Get the similar movies for a specific movie id.
*
* @param $movie_id
* @param array $parameters
* @param array $headers
* @return mixed
*/
public function getSimilar($movie_id, array $parameters = array(), array $headers = array())
{
return $this->get('movie/' . $movie_id . '/similar', $parameters, $headers);
}

/**
Expand Down
17 changes: 17 additions & 0 deletions lib/Tmdb/Api/People.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ public function getExternalIds($person_id, array $parameters = array(), array $h
return $this->get('person/' . $person_id . '/external_ids', $parameters, $headers);
}

/**
* Get the images that have been tagged with a specific person id.
*
* We return all of the image results with a media object mapped for each image.
*
* @param $person_id
* @param array $parameters
* @param array $headers
* @return mixed
*
* @todo Still does not contain the media and media_type properties, this will be worked on later on.
*/
public function getTaggedImages($person_id, array $parameters = array(), array $headers = array())
{
return $this->get('person/' . $person_id . '/tagged_images', $parameters, $headers);
}

/**
* Get the list of popular people on The Movie Database. This list refreshes every day.
*
Expand Down
Loading

0 comments on commit 63812a5

Please sign in to comment.