mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2630: Filters with joined inheritance #3301
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Aug 22, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user fvilpoix:
Hello,
I'm trying to use SQLFilter with a Joined Inheritance, and the sql Walker never applies filters on the sub-class, even if I make my SELECT on the sub-class or the root.
In the SqlWalker, the methods 'generateFilterConditionSQL' says :
// The classes in the inheritance will be added to the query one by one,
// but only the root node is getting filtered
I don't understand why, and I would like to know if there is any way to apply filters to subclasses in joined-inheritance.
Thanks a lot :)
@doctrinebot commented on GitHub (Jan 9, 2014):
Comment created by holtkamp:
Are you sure you apply the filter on the root Entity? This discussion might be usefull:
https://groups.google.com/forum/#!topic/doctrine-user/e1cPZOorfaQ
@aftabnaveed commented on GitHub (Jan 3, 2018):
Does this limitation still exist? $targetEntity will always return the root entity which prevents us adding filters on its subclasses.
@Ocramius commented on GitHub (Jan 3, 2018):
@aftabnaveed you'd need to write a test case to demonstrate the issue.
@beberlei commented on GitHub (Dec 5, 2020):
This is expected and done by design, because generating the SQL to allow filtering on just a join requires some precise parenthesis work that would probably be hard to do.