[DDC-613] Fixing issue with using function expressions in select not being allowed
This commit is contained in:
parent
20c1ff3146
commit
d27733f690
@ -36,4 +36,7 @@ class Select extends Base
|
|||||||
{
|
{
|
||||||
protected $_preSeparator = '';
|
protected $_preSeparator = '';
|
||||||
protected $_postSeparator = '';
|
protected $_postSeparator = '';
|
||||||
|
protected $_allowedClasses = array(
|
||||||
|
'Doctrine\ORM\Query\Expr\Func'
|
||||||
|
);
|
||||||
}
|
}
|
@ -516,4 +516,13 @@ class QueryBuilderTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
|
|
||||||
$this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState());
|
$this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSelectWithFuncExpression()
|
||||||
|
{
|
||||||
|
$qb = $this->_em->createQueryBuilder();
|
||||||
|
$expr = $qb->expr();
|
||||||
|
$qb->select($expr->count('e.id'));
|
||||||
|
|
||||||
|
$this->assertValidQueryBuilder($qb, 'SELECT COUNT(e.id)');
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user