Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2046

QueryBuilder allows joining with the same alias multiple times

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DQL
    • Security Level: All
    • Labels:
      None

      Description

      Currently, QueryBuilder allows assembling broken DQL like

      SELECT u FROM User u JOIN u.posts p JOIN u.logs p

      or

      SELECT u FROM User u JOIN u.posts u

      It may be interesting if we either replace DQL parts by associating them to their alias.

      Another solution, since Alexander noted that it is a dumb string builder, is to throw exceptions early to disallow broken DQL generation (such as in the second case).

      It may also be useful to allow giving insights about the currently existing joined aliases.

      public function hasJoinedAlias($alias);

        Activity

        Marco Pivetta created issue -
        Hide
        Marco Pivetta added a comment -

        Attaching failing test case

        Show
        Marco Pivetta added a comment - Attaching failing test case
        Marco Pivetta made changes -
        Field Original Value New Value
        Attachment DDC2046Test.php [ 11328 ]
        Hide
        Marco Pivetta added a comment -

        The query builder should not worry about validity of produced DQL

        Show
        Marco Pivetta added a comment - The query builder should not worry about validity of produced DQL
        Marco Pivetta made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2046, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Marco Pivetta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: