fixed belongs_to eager loading bug when parent does not exist.

This commit is contained in:
Taylor Otwell 2011-06-18 09:54:50 -05:00
parent 8f8c5f6dd4
commit c751844aab
1 changed files with 4 additions and 1 deletions

View File

@ -201,7 +201,10 @@ private static function eagerly_load_belonging($relationship, &$parents, $relati
// -----------------------------------------------------
foreach ($parents as &$parent)
{
$parent->ignore[$include] = $children[$parent->$relating_key];
if (array_key_exists($parent->$relating_key, $children))
{
$parent->ignore[$include] = $children[$parent->$relating_key];
}
}
}