Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 16, 2014
1 parent 1e96217 commit 92ca2a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/Tmdb/Factory/People/CastFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public function createCollection(array $data = array(), $person = null)
{
$collection = new Cast();

$class = get_class($person);

foreach($data as $item) {
$collection->add(null, $this->create($item, $person));
$collection->add(null, $this->create($item, new $class()));
}

return $collection;
Expand Down
4 changes: 3 additions & 1 deletion lib/Tmdb/Factory/People/CrewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public function createCollection(array $data = array(), $person = null)
{
$collection = new Crew();

$class = get_class($person);

foreach($data as $item) {
$collection->add(null, $this->create($item, $person));
$collection->add(null, $this->create($item, new $class()));
}

return $collection;
Expand Down

0 comments on commit 92ca2a4

Please sign in to comment.