diff --git a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php index 6e791472..da338971 100644 --- a/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php +++ b/lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php @@ -15,6 +15,7 @@ namespace Tmdb\Model\Query\Discover; use DateTime; +use Tmdb\Model\AbstractModel; use Tmdb\Model\Collection\QueryParametersCollection; /** @@ -314,4 +315,19 @@ public function withNetworksAnd(array $networks = []) implode(',', $networks) ); } + + /** + * Extract object id's if an collection was passed on. + * + * @param $mixed + * @return mixed + */ + protected function normalize($mixed) + { + if (is_object($mixed) && $mixed instanceof AbstractModel) { + return $mixed->getId(); + } + + return $mixed; + } }