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

Commit

Permalink
Merge pull request #10 from spiral/join-method-forced
Browse files Browse the repository at this point in the history
Update AbstractLoader.php
  • Loading branch information
vvval authored Jul 27, 2017
2 parents 2e3125f + 421b354 commit d2b929e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/Spiral/ORM/Entities/Loaders/AbstractLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ final public function loadRelation(
}

if ($join) {
//Let's tell our loaded that it's method is JOIN (forced)
$options['method'] = self::JOIN;
if (empty($options['method']) || !in_array($options['method'], [self::JOIN, self::LEFT_JOIN])) {
//Let's tell our loaded that it's method is JOIN (forced)
$options['method'] = self::JOIN;
}
}

if (isset($loaders[$relation])) {
Expand Down Expand Up @@ -364,4 +366,4 @@ private function loadChain(string $chain, array $options, bool $join): LoaderInt
$join
);
}
}
}

0 comments on commit d2b929e

Please sign in to comment.