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.
Adding Changes API section, added Query object to support this behavi…
…our.
- Loading branch information
1 parent
3a6ce54
commit dca8277
Showing
11 changed files
with
304 additions
and
181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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); | ||
|
||
$query = new \Tmdb\Model\Query\ChangesQuery(); | ||
|
||
$from = new \DateTime('01-01-2012'); | ||
$to = new \DateTime('08-01-2012'); | ||
|
||
$query | ||
->page(1) | ||
->from($from) | ||
->to($to) | ||
; | ||
|
||
$repository = new \Tmdb\Repository\ChangesRepository($client); | ||
$response = $repository->getPeopleChanges($query); | ||
|
||
var_dump($response); | ||
|
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,73 @@ | ||
<?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; | ||
|
||
use Tmdb\Client; | ||
|
||
class Change extends AbstractModel { | ||
/** | ||
* @var integer | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var boolean | ||
*/ | ||
private $adult; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public static $_properties = array( | ||
'id', | ||
'adult' | ||
); | ||
|
||
/** | ||
* @param boolean $adult | ||
* @return $this | ||
*/ | ||
public function setAdult($adult) | ||
{ | ||
$this->adult = $adult; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return boolean | ||
*/ | ||
public function getAdult() | ||
{ | ||
return $this->adult; | ||
} | ||
|
||
/** | ||
* @param int $id | ||
* @return $this | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
<?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\Common\GenericCollection; | ||
|
||
class QueryParametersCollection extends GenericCollection {} |
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,95 @@ | ||
<?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\Common\GenericCollection; | ||
|
||
class ResultCollection extends GenericCollection { | ||
/** | ||
* @var int | ||
*/ | ||
private $page = 1; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $totalPages = 1; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $totalResults = 0; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public static $_properties = array( | ||
'page', | ||
'total_pages', | ||
'total_results' | ||
); | ||
|
||
/** | ||
* @param int $page | ||
* @return $this | ||
*/ | ||
public function setPage($page) | ||
{ | ||
$this->page = $page; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getPage() | ||
{ | ||
return $this->page; | ||
} | ||
|
||
/** | ||
* @param int $totalPages | ||
* @return $this | ||
*/ | ||
public function setTotalPages($totalPages) | ||
{ | ||
$this->totalPages = $totalPages; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getTotalPages() | ||
{ | ||
return $this->totalPages; | ||
} | ||
|
||
/** | ||
* @param int $totalResults | ||
* @return $this | ||
*/ | ||
public function setTotalResults($totalResults) | ||
{ | ||
$this->totalResults = $totalResults; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getTotalResults() | ||
{ | ||
return $this->totalResults; | ||
} | ||
} |
Oops, something went wrong.