Skip to content

Commit

Permalink
Updating README and PeopleRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 26, 2014
1 parent 3ebc6b4 commit 6078fbe
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 36 deletions.
36 changes: 0 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,11 @@ Stable
[![Latest Stable Version](https://poser.pugx.org/wtfzdotnet/php-tmdb-api/v/stable.png)](https://packagist.org/packages/wtfzdotnet/php-tmdb-api)
[![Dependency Status](https://www.versioneye.com/user/projects/530a7514ec137594df000010/badge.png)](https://www.versioneye.com/user/projects/530a7514ec137594df000010)

First alpha version will be arriving around the beginning of March, take a look at the current state below.

Unstable
----------------

[![Latest Unstable Version](https://poser.pugx.org/wtfzdotnet/php-tmdb-api/v/unstable.png)](https://packagist.org/packages/wtfzdotnet/php-tmdb-api)

**The states for now defined as;**

- Done, everything should be functional.
- Review, requires another review before we can mark it as done.
- Todo, requires everything still to be implemented.

| API Namespace | Status |
|------------------------|:------------|
| Configuration | Done |
| Account | **TODO** |
| Authentication | **TODO** |
| Certifications | Done |
| Changes | Done |
| Collections | Done |
| Companies | Done |
| Credits | Done |
| Discover | Done |
| Find | Done |
| Genres | Done |
| Jobs | Done |
| Keywords | Done |
| Lists | Done * |
| Movies | Done * |
| Networks | Done |
| People | Done |
| Reviews | Done |
| Search | Done |
| TV | Done |
| TV Seasons | Done |
| TV Episodes | Done |

__* Currently the account related functions are missing from these sections.__


Help & Donate
--------------

Expand Down
74 changes: 74 additions & 0 deletions lib/Tmdb/Repository/PeopleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,80 @@ public function getCombinedCredits($id, array $parameters = array(), array $head
return $person->getCombinedCredits();
}

/**
* Get the external ids for a specific person id.
*
* @param $id
* @return null|\Tmdb\Model\AbstractModel
*/
public function getExternalIds($id)
{
$data = $this->getApi()->getCombinedCredits($id);
$person = $this->getFactory()->create(array('external_ids' => $data));

return $person->getExternalIds();
}

/**
* Get the images for a specific person id.
*
* @param $id
* @return null|\Tmdb\Model\AbstractModel
*/
public function getImages($id)
{
$data = $this->getApi()->getCombinedCredits($id);
$person = $this->getFactory()->create(array('images' => $data));

return $person->getImages();
}

/**
* Get the changes for a specific person id.
*
* Changes are grouped by key, and ordered by date in descending order.
*
* By default, only the last 24 hours of changes are returned.
* The maximum number of days that can be returned in a single request is 14.
* The language is present on fields that are translatable.
*
* @param $id
* @param array $parameters
* @param array $headers
* @return null|\Tmdb\Model\AbstractModel
*/
public function getChanges($id, array $parameters = array(), array $headers = array())
{
$data = $this->getApi()->getChanges($id, $this->parseQueryParameters($parameters), $headers);
$person = $this->getFactory()->create(array('changes' => $data));

return $person->getChanges();
}

/**
* Get the list of popular people on The Movie Database.
*
* This list refreshes every day.
*
* @return null|\Tmdb\Model\AbstractModel
*/
public function getPopular()
{
$data = $this->getApi()->getPopular();
return $this->getFactory()->createResultCollection($data);
}

/**
* Get the latest person id.
*
* @return null|\Tmdb\Model\AbstractModel
*/
public function getLatest()
{
$data = $this->getApi()->getLatest();
return $this->getFactory()->create($data);
}

/**
* Return the related API class
*
Expand Down

0 comments on commit 6078fbe

Please sign in to comment.