DDC-3612: Make SQLFilter#em protected #4440

Open
opened 2026-01-22 14:41:42 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 11, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user nurikabe:

SQLFilter#em is private, which can be troublesome when extending SQLFilter. I notice, for example, that the Gedmo SoftDeleteableFilter goes to the trouble of using reflection to get access to SoftDeleteableFilter#em.

Originally created by @doctrinebot on GitHub (Mar 11, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user nurikabe: SQLFilter#em is private, which can be troublesome when extending SQLFilter. I notice, for example, that the Gedmo SoftDeleteableFilter goes to the trouble of using reflection to get access to SoftDeleteableFilter#em.
admin added the Improvement label 2026-01-22 14:41:42 +01:00
Author
Owner

@Steveb-p commented on GitHub (Jun 12, 2019):

I've found this issue when I was looking for anything related to extending SQLFilter class. Is this still something that would be accepted if a PR would be provided?

From what I've seen from code usage it would be worthwile to add an interface, since it is not strictly required for one to extend SQLFilter for a class to work with SqlWalker (I've tested this in my app and filter was applied successfully just based on the result of addFilterConstraint method - I know that there is also the case of parameters, but I believe SQLFilter should be more "extension-friendly"? Maybe drop final from __construct to allow passing additional dependencies, if there are any required)

@Steveb-p commented on GitHub (Jun 12, 2019): I've found this issue when I was looking for anything related to extending `SQLFilter` class. Is this still something that would be accepted if a PR would be provided? From what I've seen from code usage it would be worthwile to add an interface, since it is not strictly required for one to extend `SQLFilter` for a class to work with `SqlWalker` (I've tested this in my app and filter was applied successfully just based on the result of `addFilterConstraint` method - I know that there is also the case of parameters, but I believe `SQLFilter` should be more "extension-friendly"? Maybe drop `final` from `__construct` to allow passing additional dependencies, if there are any required)
Author
Owner

@sebsastianek commented on GitHub (Oct 16, 2019):

+1 for dropping final in constructor of SQLFilter

@sebsastianek commented on GitHub (Oct 16, 2019): +1 for dropping final in constructor of SQLFilter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4440