Skip to content

Commit

Permalink
Cleaning up the Generic Collection factory
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 2, 2014
1 parent cea794f commit c81e0c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Tmdb/Factory/Common/GenericCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c81e0c7

Please sign in to comment.