Skip to content

Commit 4eafbff

Browse files
committed
better fix for #513
1 parent a181bb7 commit 4eafbff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4917,12 +4917,13 @@ private function addJoinsForTables(ReflectedTable $t1, PathTree $joins, array &$
49174917
foreach ($joins->getKeys() as $t2Name) {
49184918

49194919
$t2 = $this->reflection->getTable($t2Name);
4920-
$t3 = null;
4921-
4920+
49224921
$belongsTo = count($t1->getFksTo($t2->getName())) > 0;
49234922
$hasMany = count($t2->getFksTo($t1->getName())) > 0;
49244923
if (!$belongsTo && !$hasMany) {
49254924
$t3 = $this->hasAndBelongsToMany($t1, $t2);
4925+
} else {
4926+
$t3 = null;
49264927
}
49274928
$hasAndBelongsToMany = ($t3 != null);
49284929

0 commit comments

Comments
 (0)