1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Added indexBy option to createQueryBuilder

Added way to access the underlying QueryBuilder#from() method's 'indexBy' parameter when using EntityRepository#createQueryBuilder()
This commit is contained in:
Christian Morgan 2013-08-28 22:35:29 +01:00
parent d7881a1ec2
commit b0513a7517

View File

@ -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);
}
/**