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:
parent
d7881a1ec2
commit
b0513a7517
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user