Skip to content

Commit

Permalink
Use IdentifierExpression for join on clause
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed Jul 18, 2020
1 parent 8d1c8ba commit bea0655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/TestCase/ORM/QueryTest.php
Expand Up @@ -4070,7 +4070,7 @@ public function testSubqueryJoinClause()
$query = $this->getTableLocator()->get('Authors')->find();
$query
->select(['Authors.id', 'total_articles' => $query->func()->count('articles.author_id')])
->leftJoin(['articles' => $subquery], ['articles.author_id = Authors.id'])
->leftJoin(['articles' => $subquery], ['articles.author_id' => new IdentifierExpression('Authors.id')])
->group(['Authors.id'])
->order(['Authors.id' => 'ASC']);

Expand Down

0 comments on commit bea0655

Please sign in to comment.