-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from vfalies/refactoring_get
Refactoring get
- Loading branch information
Showing
20 changed files
with
258 additions
and
128 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,42 @@ | ||
<?php | ||
|
||
namespace vfalies\tmdb; | ||
|
||
use vfalies\tmdb\Catalogs\Genres; | ||
|
||
class Catalog | ||
{ | ||
|
||
private $tmdb = null; | ||
|
||
/** | ||
* Constructor | ||
* @param \vfalies\tmdb\Tmdb $tmdb | ||
*/ | ||
public function __construct(Tmdb $tmdb) | ||
{ | ||
$this->tmdb = $tmdb; | ||
} | ||
|
||
/** | ||
* Get movie genres list | ||
* @param array $options | ||
* @return \Generator | ||
*/ | ||
public function getMovieGenres(array $options = array()): \Generator | ||
{ | ||
$catalog = new Genres($this->tmdb); | ||
return $catalog->getMovieList($options); | ||
} | ||
|
||
/** | ||
* Get TVShow genres list | ||
* @param array $options | ||
* @return \Generator | ||
*/ | ||
public function getTVShowGenres(array $options = array()): \Generator | ||
{ | ||
$catalog = new Genres($this->tmdb); | ||
return $catalog->getTVList($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
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,63 @@ | ||
<?php | ||
|
||
namespace vfalies\tmdb; | ||
|
||
use vfalies\tmdb\Items\Movie; | ||
use vfalies\tmdb\Items\Collection; | ||
use vfalies\tmdb\Items\TVShow; | ||
|
||
class Item | ||
{ | ||
private $tmdb = null; | ||
|
||
/** | ||
* Constructor | ||
* @param \vfalies\tmdb\Tmdb $tmdb | ||
*/ | ||
|
||
public function __construct(Tmdb $tmdb) | ||
{ | ||
$this->tmdb = $tmdb; | ||
} | ||
|
||
/** | ||
* Get movie details | ||
* @param int $movie_id | ||
* @param array $options | ||
* @return \vfalies\tmdb\Items\Movie | ||
*/ | ||
public function getMovie(int $movie_id, array $options = array()): Movie | ||
{ | ||
$movie = new Movie($this->tmdb, $movie_id, $options); | ||
|
||
return $movie; | ||
} | ||
|
||
/** | ||
* Get collection details | ||
* @param int $collection_id | ||
* @param array $options | ||
* @return \vfalies\tmdb\Items\Collection | ||
*/ | ||
public function getCollection(int $collection_id, array $options = array()): Collection | ||
{ | ||
$collection = new Collection($this->tmdb, $collection_id, $options); | ||
|
||
return $collection; | ||
} | ||
|
||
/** | ||
* Get TV Show details | ||
* @param int $tv_id | ||
* @param array $options | ||
* @return \vfalies\tmdb\Items\TVShow | ||
*/ | ||
public function getTVShow(int $tv_id, array $options = array()): TVShow | ||
{ | ||
$tv = new TVShow($this->tmdb, $tv_id, $options); | ||
|
||
return $tv; | ||
} | ||
|
||
|
||
} |
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
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.