Skip to content

Commit

Permalink
Include normalize function
Browse files Browse the repository at this point in the history
  • Loading branch information
neildaniels committed Aug 27, 2021
1 parent ddae50d commit 322a2a0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Tmdb/Model/Query/Discover/DiscoverTvQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace Tmdb\Model\Query\Discover;

use DateTime;
use Tmdb\Model\AbstractModel;
use Tmdb\Model\Collection\QueryParametersCollection;

/**
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 322a2a0

Please sign in to comment.