Skip to content

Loading…

DDC-901: Docs DQL Custom Walkers CountSqlWalker example error #5428

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user cgmartin:

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 ...
@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-RC2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.