Skip to content

Commit 321c167

Browse files
authored
Merge pull request #73 from jpgiannetti-eukles/master
feat(QueryModifier): adding joinType parameter to useQuery method
2 parents 32bc031 + c218303 commit 321c167

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Service/QueryModifier/UseQuery/UseQueryFromDotNotation.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ public function isInUse(): bool
115115

116116
/**
117117
* @param null $alias
118+
* @param string $joinType
118119
* @return ModelCriteria
119120
* @throws UseQueryFromDotNotationException
120121
*/
121-
public function useQuery($alias = null): ModelCriteria
122+
public function useQuery($alias = null, $joinType = null): ModelCriteria
122123
{
123124
if ($this->inUse) {
124125
throw new UseQueryFromDotNotationException("A query is already in use and have not be terminated with UseQueryFromDotNotation::endUse()");
@@ -131,7 +132,7 @@ public function useQuery($alias = null): ModelCriteria
131132
$path = implode(self::RELATION_SEP, $this->map);
132133
throw new RelationNotFoundException("Relation \"$relation\" Not Found in \"$path\"");
133134
}
134-
$this->query = call_user_func([$this->query, $method], $alias . "_" . $relation);
135+
$this->query = call_user_func([$this->query, $method], $alias . "_" . $relation, $joinType);
135136
}
136137
}
137138
$this->inUse = true;

0 commit comments

Comments
 (0)