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.
- Refactoring collection locations to be more natural
- Adding query parameter bags to provide a decent API to all possible query parameters
- Loading branch information
1 parent
54128dc
commit 0812794
Showing
27 changed files
with
558 additions
and
97 deletions.
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
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
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
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
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,66 @@ | ||
<?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\Model\Collection; | ||
|
||
use Tmdb\Model\Collection\People\Cast; | ||
use Tmdb\Model\Collection\People\Crew; | ||
|
||
class Credits { | ||
/** | ||
* @var Cast | ||
*/ | ||
private $cast; | ||
|
||
/** | ||
* @var Crew | ||
*/ | ||
private $crew; | ||
|
||
/** | ||
* @param \Tmdb\Model\Collection\People\Cast $cast | ||
* @return $this | ||
*/ | ||
public function setCast($cast) | ||
{ | ||
$this->cast = $cast; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return \Tmdb\Model\Collection\People\Cast | ||
*/ | ||
public function getCast() | ||
{ | ||
return $this->cast; | ||
} | ||
|
||
/** | ||
* @param \Tmdb\Model\Collection\People\Crew $crew | ||
* @return $this | ||
*/ | ||
public function setCrew($crew) | ||
{ | ||
$this->crew = $crew; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return \Tmdb\Model\Collection\People\Crew | ||
*/ | ||
public function getCrew() | ||
{ | ||
return $this->crew; | ||
} | ||
|
||
|
||
} |
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
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
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
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,56 @@ | ||
<?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\Model\Common\Collection; | ||
|
||
use Tmdb\Model\Common\Collection; | ||
|
||
use Tmdb\Model\Keyword; | ||
|
||
class Keywords extends Collection { | ||
|
||
/** | ||
* Returns all keywords | ||
* | ||
* @return array | ||
*/ | ||
public function getKeywords() | ||
{ | ||
return $this->data; | ||
} | ||
|
||
/** | ||
* Retrieve a keyword from the collection | ||
* | ||
* @param $id | ||
* @return null | ||
*/ | ||
public function getKeyword($id) { | ||
foreach($this->data as $keyword) { | ||
if ($id === $keyword->getId()) { | ||
return $keyword; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** | ||
* Add a keyword to the collection | ||
* | ||
* @param Keyword $keyword | ||
*/ | ||
public function addKeyword(Keyword $keyword) | ||
{ | ||
$this->data[] = $keyword; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.