Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-901

Docs DQL Custom Walkers CountSqlWalker example error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.0-RC2
    • Component/s: Documentation
    • Security Level: All
    • 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 ...
      

        Activity

        Chris Martin created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Roman S. Borschel [ romanb ] Benjamin Eberlei [ beberlei ]
        Fix Version/s 2.0-RC2 [ 10112 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12175 ] jira-feedback [ 14663 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14663 ] jira-feedback2 [ 16527 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16527 ] jira-feedback3 [ 18780 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Chris Martin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: