Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit d2b929e

Browse files
authored
Merge pull request #10 from spiral/join-method-forced
Update AbstractLoader.php
2 parents 2e3125f + 421b354 commit d2b929e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/Spiral/ORM/Entities/Loaders/AbstractLoader.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ final public function loadRelation(
184184
}
185185

186186
if ($join) {
187-
//Let's tell our loaded that it's method is JOIN (forced)
188-
$options['method'] = self::JOIN;
187+
if (empty($options['method']) || !in_array($options['method'], [self::JOIN, self::LEFT_JOIN])) {
188+
//Let's tell our loaded that it's method is JOIN (forced)
189+
$options['method'] = self::JOIN;
190+
}
189191
}
190192

191193
if (isset($loaders[$relation])) {
@@ -364,4 +366,4 @@ private function loadChain(string $chain, array $options, bool $join): LoaderInt
364366
$join
365367
);
366368
}
367-
}
369+
}

0 commit comments

Comments
 (0)