Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
api-platform#1313 - LIMIT and ORDER BY on a column from a fetch joine…
Browse files Browse the repository at this point in the history
…d to-many association
  • Loading branch information
ambroisemaupate authored and meyerbaptiste committed Nov 2, 2017
1 parent 290b619 commit 3423d78
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Bridge/Doctrine/Orm/Util/QueryChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@ public static function hasOrderByOnToManyJoin(QueryBuilder $queryBuilder, Manage
$relationship = QueryJoinParser::getJoinRelationship($join);

if (false !== strpos($relationship, '.')) {
$metadata = QueryJoinParser::getClassMetadataFromJoinAlias($alias, $queryBuilder, $managerRegistry);
if ($metadata->isCollectionValuedAssociation($relationship)) {
/**
* (Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers)
*
* @see https://github.com/api-platform/core/issues/1313
*/
list($parentAlias, $association) = explode('.', $relationship);
$metadata = QueryJoinParser::getClassMetadataFromJoinAlias($parentAlias, $queryBuilder, $managerRegistry);
if ($metadata->isCollectionValuedAssociation($association)) {
return true;
}
} else {
Expand Down

0 comments on commit 3423d78

Please sign in to comment.