diff --git a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php index 66cea81d..90cf3ce2 100644 --- a/lib/Tmdb/Factory/Common/GenericCollectionFactory.php +++ b/lib/Tmdb/Factory/Common/GenericCollectionFactory.php @@ -43,10 +43,11 @@ public function createCollection(array $data = array(), $class) $class = get_class($class); } - $collection = new GenericCollection(); + $collection = new GenericCollection(); + $objectHydrator = new ObjectHydrator(); foreach($data as $item) { - $collection->add(null, ObjectHydrator::hydrate(new $class(), $item)); + $collection->add(null, $objectHydrator->hydrate(new $class(), $item)); } return $collection;