Merge pull request #823 from Vespakoen/patch-3
ATTENTION! Fixing reference issue in relationship matching (Causing MAMP, and other installs, to crash when eager-loading)
This commit is contained in:
commit
527977337d
|
@ -89,7 +89,7 @@ public function match($relationship, &$children, $parents)
|
||||||
|
|
||||||
foreach ($children as &$child)
|
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;
|
return $v->get_key() == $child->$foreign;
|
||||||
});
|
});
|
||||||
|
|
|
@ -93,7 +93,7 @@ public function match($relationship, &$parents, $children)
|
||||||
|
|
||||||
foreach ($parents as &$parent)
|
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();
|
return $v->$foreign == $parent->get_key();
|
||||||
});
|
});
|
||||||
|
|
|
@ -327,7 +327,7 @@ public function match($relationship, &$parents, $children)
|
||||||
|
|
||||||
foreach ($parents as &$parent)
|
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();
|
return $v->pivot->$foreign == $parent->get_key();
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,7 @@ public function match($relationship, &$parents, $children)
|
||||||
|
|
||||||
foreach ($parents as &$parent)
|
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();
|
return $v->$foreign == $parent->get_key();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue