1
0
mirror of synced 2025-01-18 22:41:43 +03:00

[DDC-613] Fixing issue with using function expressions in select not being allowed

This commit is contained in:
Jonathan H. Wage 2010-06-16 11:55:22 -04:00
parent 20c1ff3146
commit d27733f690
2 changed files with 12 additions and 0 deletions

View File

@ -36,4 +36,7 @@ class Select extends Base
{
protected $_preSeparator = '';
protected $_postSeparator = '';
protected $_allowedClasses = array(
'Doctrine\ORM\Query\Expr\Func'
);
}

View File

@ -516,4 +516,13 @@ class QueryBuilderTest extends \Doctrine\Tests\OrmTestCase
$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)');
}
}