Skip to content

Commit

Permalink
expose Imdb i Tmdb via Api
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Pudełek committed Dec 8, 2017
1 parent ec569d8 commit 2e9f5bc
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/Api.php
Expand Up @@ -9,7 +9,7 @@
* For the full copyright and license information, please view source file
* that is bundled with this package in the file LICENSE
*
* @author Marcin Pudełek <marcin@pudelek.org.pl>
* @author Marcin Pudełek <marcin@pudelek.org.pl>
*/

/**
Expand All @@ -32,6 +32,15 @@ class Api
*/
private $oClient;

/**
* @var \mrcnpdlk\Xmdb\Tmdb
*/
private $oTmdbApi;
/**
* @var \mrcnpdlk\Xmdb\Imdb
*/
private $oImdbApi;


/**
* Api constructor.
Expand Down Expand Up @@ -78,4 +87,29 @@ public function getClient(): Client
return $this->oClient;
}

/**
* @return \mrcnpdlk\Xmdb\Imdb
* @throws \mrcnpdlk\Xmdb\Exception
*/
public function getImdbApi(): Imdb
{
if (null === $this->oImdbApi) {
$this->oImdbApi = new Imdb($this->oClient);
}

return $this->oImdbApi;
}

/**
* @return \mrcnpdlk\Xmdb\Tmdb
* @throws \mrcnpdlk\Xmdb\Exception
*/
public function getTmdbApi(): Tmdb
{
if (null === $this->oTmdbApi) {
$this->oTmdbApi = new Tmdb($this->oClient);
}

return $this->oTmdbApi;
}
}

0 comments on commit 2e9f5bc

Please sign in to comment.