Fixing reference issue in relationship matching

This commit is contained in:
Koen Schmeets 2012-06-16 17:52:07 +02:00
parent b27b132128
commit aeeb010e0a
4 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@ public function match($relationship, &$children, $parents)
foreach ($children as &$child)
{
$parent = array_first($parents, function($k, $v) use ($child, $foreign)
$parent = array_first($parents, function($k, $v) use (&$child, $foreign)
{
return $v->get_key() == $child->$foreign;
});

View File

@ -93,7 +93,7 @@ public function match($relationship, &$parents, $children)
foreach ($parents as &$parent)
{
$matching = array_filter($children, function($v) use ($parent, $foreign)
$matching = array_filter($children, function($v) use (&$parent, $foreign)
{
return $v->$foreign == $parent->get_key();
});

View File

@ -327,7 +327,7 @@ public function match($relationship, &$parents, $children)
foreach ($parents as &$parent)
{
$matching = array_filter($children, function($v) use ($parent, $foreign)
$matching = array_filter($children, function($v) use (&$parent, $foreign)
{
return $v->pivot->$foreign == $parent->get_key();
});

View File

@ -40,7 +40,7 @@ public function match($relationship, &$parents, $children)
foreach ($parents as &$parent)
{
$matching = array_first($children, function($k, $v) use ($parent, $foreign)
$matching = array_first($children, function($k, $v) use (&$parent, $foreign)
{
return $v->$foreign == $parent->get_key();
});