Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c7f454e

Browse files
author
Thomas Rabaix
committedMay 17, 2011
Add DISTINCT clause to the ProxyQuery while fetching identifiers
1 parent d42ae6f commit c7f454e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎Datagrid/ORM/ProxyQuery.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ private function getFixedQueryBuilder(QueryBuilder $queryBuilder)
6767

6868
// step 3 : retrieve the different subjects id
6969
$select = sprintf('%s.%s', $queryBuilderId->getRootAlias(), $idName);
70-
$queryBuilderId->select($select);
70+
$queryBuilderId->resetDQLPart('select');
71+
$queryBuilderId->add('select', 'DISTINCT '.$select);
72+
7173
$results = $queryBuilderId->getQuery()->execute(array(), Query::HYDRATE_ARRAY);
7274
$idx = array();
7375
$connection = $queryBuilder->getEntityManager()->getConnection();

0 commit comments

Comments
 (0)
Please sign in to comment.