DDC-2046: QueryBuilder allows joining with the same alias multiple times #2725

Closed
doctrinebot opened this Issue Sep 27, 2012 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user @ocramius:

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 [~asm89] 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);

@doctrinebot

Comment created by @ocramius:

Attaching failing test case

@doctrinebot

Comment created by @ocramius:

The query builder should not worry about validity of produced DQL

@doctrinebot

Issue was closed with resolution "Won't Fix"

@Ocramius Ocramius was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment