-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make QueryBuilder::getAllAliases public #1303
make QueryBuilder::getAllAliases public #1303
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-3567 We use Jira to track the state of pull requests and the versions they got |
@mrkrstphr what's the exact use-case here? |
I have a Query object which has several methods the user can call to control which data gets returned. This Query object internally uses the QueryBuilder. Some of the methods need to join with other entities and add where clauses. I need a way to internally check if I've already joined with a table before trying to join it again. As I control the aliases internally, I can simply rely on seeing if the alias was defined. I could keep a running list myself, but saw that the QueryBuilder object had this available and thought it'd be nice to expose that information. |
Why not just using |
Because then I end up joining with the same entity over and over again when it's not necessary. |
This seems like an useless optimization to me, no? Shouldn't the caller code have an idea of what was already fetched in the join? That said, I don't think there are any problems with making the method |
make QueryBuilder::getAllAliases public
👍 |
Being able to get all already defined aliases in the QueryBuilder can be helpful when dynamically joining.
Funny, the DocBlock makes it seem as if this method was already public.