forked from php-tmdb/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added most of the API functionality, except for anything that requrie…
…s sessions, such as the accounts and lists etc.
- Loading branch information
1 parent
0d4e0d7
commit 14a13d3
Showing
16 changed files
with
1,064 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
use Tmdb\Exception\NotImplementedException; | ||
|
||
class Account | ||
extends AbstractApi | ||
{ | ||
/** | ||
* Get the basic information for an account. You will need to have a valid session id. | ||
* | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getAccount(array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Get the lists that you have created and marked as a favorite. | ||
* | ||
* @param $account_id | ||
* @param $options array | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getLists($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Get the list of favorite movies for an account. | ||
* | ||
* @param $account_id | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getFavoriteMovies($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Add or remove a movie to an accounts favorite list. | ||
* | ||
* @param $account_id | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function favorite($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Get the list of rated movies (and associated rating) for an account. | ||
* | ||
* @param $account_id | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getRatedMovies($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Get the list of movies on an accounts watchlist. | ||
* | ||
* @param $account_id | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getMovieWatchlist($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* Add or remove a movie to an accounts watch list. | ||
* | ||
* @param $account_id | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function watchlist($account_id, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
use Tmdb\Exception\NotImplementedException; | ||
|
||
class Authentication | ||
extends AbstractApi | ||
{ | ||
/** | ||
* This method is used to generate a valid request token for user based authentication. | ||
* A request token is required in order to request a session id. | ||
* | ||
* You can generate any number of request tokens but they will expire after 60 minutes. | ||
* As soon as a valid session id has been created the token will be destroyed. | ||
* | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getNewToken(array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* This method is used to generate a session id for user based authentication. | ||
* A session id is required in order to use any of the write methods. | ||
* | ||
* @param $request_token | ||
* @param $options array | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getNewSession($request_token, array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
|
||
/** | ||
* This method is used to generate a guest session id. | ||
* | ||
* A guest session can be used to rate movies without having a registered TMDb user account. | ||
* You should only generate a single guest session per user (or device) | ||
* as you will be able to attach the ratings to a TMDb user account in the future. | ||
* | ||
* There is also IP limits in place so you should always make sure it's the end user doing the guest session actions. | ||
* | ||
* If a guest session is not used for the first time within 24 hours, it will be automatically discarded. | ||
* | ||
* @param array $options | ||
* @throws NotImplementedException | ||
* @return mixed | ||
*/ | ||
public function getNewGuestSession(array $options = array()) | ||
{ | ||
throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
class Changes | ||
extends AbstractApi | ||
{ | ||
/** | ||
* Get a list of movie ids that have been edited. | ||
* | ||
* By default we show the last 24 hours and only 100 items per page. | ||
* The maximum number of days that can be returned in a single request is 14. | ||
* | ||
* You can then use the movie changes API to get the actual data that has been changed. | ||
* | ||
* Please note that the change log system to support this was changed | ||
* on October 5, 2012 and will only show movies that have been edited since. | ||
* | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getMovieChanges(array $options = array()) | ||
{ | ||
return $this->get('movie/changes/', $options); | ||
} | ||
|
||
/** | ||
* Get a list of people ids that have been edited. | ||
* | ||
* By default we show the last 24 hours and only 100 items per page. | ||
* The maximum number of days that can be returned in a single request is 14. | ||
* | ||
* You can then use the movie changes API to get the actual data that has been changed. | ||
* | ||
* Please note that the change log system to support this was changed | ||
* on October 5, 2012 and will only show movies that have been edited since. | ||
* | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getPeopleChanges(array $options = array()) | ||
{ | ||
return $this->get('person/changes/', $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
class Collections | ||
extends AbstractApi | ||
{ | ||
/** | ||
* Get the basic collection information for a specific collection id. | ||
* | ||
* You can get the ID needed for this method by making a /movie/{id} request | ||
* and paying attention to the belongs_to_collection hash. | ||
* | ||
* Movie parts are not sorted in any particular order. | ||
* If you would like to sort them yourself you can use the provided release_date. | ||
* | ||
* @param $collection_id | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getCollection($collection_id, array $options = array()) | ||
{ | ||
return $this->get('collection/' . $collection_id, $options); | ||
} | ||
|
||
/** | ||
* Get all of the images for a particular collection by collection id. | ||
* | ||
* @param $collection_id | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getImages($collection_id, array $options = array()) | ||
{ | ||
return $this->get('collection/' . $collection_id . '/images', $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
class Companies | ||
extends AbstractApi | ||
{ | ||
/** | ||
* This method is used to retrieve all of the basic information about a company. | ||
* | ||
* @param $company_id | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getCompany($company_id, array $options = array()) | ||
{ | ||
return $this->get('company/' . $company_id, $options); | ||
} | ||
|
||
/** | ||
* Get the list of movies associated with a particular company. | ||
* | ||
* @param $company_id | ||
* @param array $options | ||
* @return mixed | ||
*/ | ||
public function getMovies($company_id, array $options = array()) | ||
{ | ||
return $this->get('company/' . $company_id . '/movies', $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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 <michael@wtfz.net> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Api; | ||
|
||
class Configuration | ||
extends AbstractApi | ||
{ | ||
/** | ||
* Get the system wide configuration information. | ||
* | ||
* Some elements of the API require some knowledge of this configuration data. | ||
* | ||
* The purpose of this is to try and keep the actual API responses as light as possible. | ||
* It is recommended you store this data within your application and check for updates every so often. | ||
* | ||
* This method currently holds the data relevant to building image URLs as well as the change key map. | ||
* | ||
* To build an image URL, you will need 3 pieces of data. | ||
* The base_url, size and file_path. | ||
* | ||
* Simply combine them all and you will have a fully qualified URL. Here’s an example URL: | ||
* | ||
* http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg | ||
* | ||
* @return mixed | ||
*/ | ||
public function getConfiguration() | ||
{ | ||
return $this->get('configuration'); | ||
} | ||
} |
Oops, something went wrong.