Skip to content

Commit

Permalink
Added indexBy option to createQueryBuilder
Browse files Browse the repository at this point in the history
Added way to access the underlying QueryBuilder#from() method's 'indexBy' parameter when using EntityRepository#createQueryBuilder()
  • Loading branch information
caponica committed Aug 28, 2013
1 parent d7881a1 commit b0513a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ public function __construct($em, Mapping\ClassMetadata $class)
* Creates a new QueryBuilder instance that is prepopulated for this entity name.
*
* @param string $alias
* @param string $indexBy The index for the from.
*
* @return QueryBuilder
*/
public function createQueryBuilder($alias)
public function createQueryBuilder($alias, $indexBy = null)
{
return $this->_em->createQueryBuilder()
->select($alias)
->from($this->_entityName, $alias);
->from($this->_entityName, $alias, $indexBy);
}

/**
Expand Down

0 comments on commit b0513a7

Please sign in to comment.