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.
Implementing Lists API into the modelled sections
- Loading branch information
1 parent
382b694
commit d958f28
Showing
15 changed files
with
427 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?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); | ||
|
||
$repository = new \Tmdb\Repository\ListRepository($client); | ||
$result = $repository->add(TMDB_LIST_ID, 150); | ||
|
||
var_dump($result); |
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,25 @@ | ||
<?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); | ||
|
||
$repository = new \Tmdb\Repository\ListRepository($client); | ||
$result = $repository->createList('php-tmdb-api', 'just a test'); | ||
|
||
var_dump($result); |
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,25 @@ | ||
<?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); | ||
|
||
$repository = new \Tmdb\Repository\ListRepository($client); | ||
$result = $repository->remove(TMDB_LIST_ID, 150); | ||
|
||
var_dump($result); |
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,71 @@ | ||
<?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\Lists; | ||
|
||
use Tmdb\Model\AbstractModel; | ||
|
||
class Result extends AbstractModel { | ||
/** | ||
* @var int | ||
*/ | ||
private $statusCode; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $statusMessage; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public static $_properties = array( | ||
'status_code', | ||
'status_message' | ||
); | ||
|
||
/** | ||
* @param int $statusCode | ||
* @return $this | ||
*/ | ||
public function setStatusCode($statusCode) | ||
{ | ||
$this->statusCode = $statusCode; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getStatusCode() | ||
{ | ||
return $this->statusCode; | ||
} | ||
|
||
/** | ||
* @param string $statusMessage | ||
* @return $this | ||
*/ | ||
public function setStatusMessage($statusMessage) | ||
{ | ||
$this->statusMessage = $statusMessage; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getStatusMessage() | ||
{ | ||
return $this->statusMessage; | ||
} | ||
} |
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 <[email protected]> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Model\Lists; | ||
|
||
class ResultWithListId extends Result { | ||
/** | ||
* @var string | ||
*/ | ||
private $listId; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public static $_properties = array( | ||
'status_code', | ||
'status_message', | ||
'list_id' | ||
); | ||
|
||
/** | ||
* @param string $listId | ||
* @return $this | ||
*/ | ||
public function setListId($listId) | ||
{ | ||
$this->listId = $listId; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getListId() | ||
{ | ||
return $this->listId; | ||
} | ||
} |
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.