[DDC-901] Docs DQL Custom Walkers CountSqlWalker example error Created: 29/Nov/10  Updated: 12/Dec/10  Resolved: 12/Dec/10

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Documentation
Affects Version/s: Git Master
Fix Version/s: 2.0-RC2
Security Level: All

Type: Bug Priority: Major
Reporter: Chris Martin Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Getting invalid SQL when using the CountSqlWalker example in the DQL Custom Walkers docs:

SELECT count(DISTINCT z0_.) AS sclr0 FROM ...

From what looks like this part of the example:

...
$pathExpression = new PathExpression(
    PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $parentName, array(
    $parent['metadata']->getSingleIdentifierFieldName())
);
...

If you move the field name (3rd parameter) out of the array, it seems to work:

...
$pathExpression = new PathExpression(
    PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $parentName, 
    $parent['metadata']->getSingleIdentifierFieldName()
);
...
SELECT count(DISTINCT z0_.id) AS sclr0 FROM ...


 Comments   
Comment by Benjamin Eberlei [ 12/Dec/10 ]

Fixed

Generated at Sat Nov 22 11:51:56 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.