From b0513a75173326016e39800c0f513f3f5e9e908f Mon Sep 17 00:00:00 2001 From: Christian Morgan Date: Wed, 28 Aug 2013 22:35:29 +0100 Subject: [PATCH] Added indexBy option to createQueryBuilder Added way to access the underlying QueryBuilder#from() method's 'indexBy' parameter when using EntityRepository#createQueryBuilder() --- lib/Doctrine/ORM/EntityRepository.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index 9a968d1ba..cb6dd6ffd 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -75,14 +75,15 @@ class EntityRepository implements ObjectRepository, Selectable * 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); } /**