Skip to content

Commit

Permalink
fix: allow 2-part names for depencencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gurucomkz authored Jan 15, 2022
1 parent 6504f9f commit 3dddd26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/EagerLoadedDataList.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ public function eagerLoadHasMany($data, $hasManys, $withHasManys)
foreach ($withHasManys as $depSeq) {
$dep = $depSeq[0];
$depClass = $hasManys[$dep];
$localNameInDep = $localClassTail;
if (false !== strpos($depClass, '.')) {
$dcSplit = explode('.', $depClass, 2);
$depClass = $dcSplit[0];
$localNameInDep = $dcSplit[1];
} else {
$localNameInDep = $localClassTail;
}
$depKey = "{$localNameInDep}ID";
$descriptor = [
'class' => $depClass,
Expand Down

0 comments on commit 3dddd26

Please sign in to comment.