Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Service/QueryModifier/Easy/Modifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function methodExists($method)
*/
public function orderBy(string $dotProperty, $order = Criteria::ASC): ModelCriteria
{
$property = $this->before($dotProperty);
$property = $this->before($dotProperty, Criteria::LEFT_JOIN);
$method = $this->buildMethodName(__FUNCTION__, $property);
try{
$this->query = $this->query->{$method}($order);
Expand Down Expand Up @@ -111,19 +111,19 @@ private function after()

/**
* @param string $dotProperty
*
* @param string|null $joinType
* @return string
* @throws UseQueryFromDotNotationException
*/
private function before(string $dotProperty)
private function before(string $dotProperty, string $joinType = null)
{

$dotProperty = trim($dotProperty, UseQueryFromDotNotation::RELATION_SEP);
$parts = explode(UseQueryFromDotNotation::RELATION_SEP, $dotProperty);
$property = ucfirst(array_pop($parts));

$this->dotUseQuery = new UseQueryFromDotNotation($this->query);
$this->query = $this->dotUseQuery->fromArray($parts)->useQuery();
$this->query = $this->dotUseQuery->fromArray($parts)->useQuery(null, $joinType);

return $property;
}
Expand Down