Fix problem with different comparisons on the same field in QueryExpr…
Add criteria field aliasing.
thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:
I don't like that the visitor gets all the additional code, this is not really his responsibility.
I don't see a good way to implement this features outside. Parameter and alias handling require visit all expressions.
The visitor seems to be at least partially responsible here. All of the expressions need to be visited to add the alias in the WHERE expression. The visitor was already doing this.
However, with this implementation, the visitor gains the now:
Those three things can be can be corrected. What would be the acceptable solution here?
This PR can be splitted into 2 parts like described in annotation:
The only way to break the logic i see is to create independent FieldAliasVisitor for Criteria -> Criteria converting
This Visitor can be added to the doctrine-common.
@beberlei What do you think?
@beberlei Any news? I can remove field alias from this PR and just save the parameter bugfix, which can be applied for 2.4
ping @beberlei it would be great to either merge this, or find an alternative
Criteria still can't be used on the QueryBuilder in 2.4.
We use it to implement Domain Driven Design, in which a Repository behaves like an in-memory collection. Criterias are supposed to be an abstraction for filtering collections, but right now it's only usable with ArrayCollections, so it kind of defeat the purpose of the abstraction.
I merged a fix for this by into master.