Filters in doctrine
2 answers
Doctrine 2.2 has a filtering system that allows the developer to add SQL to conditional clauses, regardless of where the SQL is generated (for example, from a DQL query or by loading related objects).
The filter functionality works at the SQL level. Whether the SQL query is created in Persister, on lazy loading, in extra lazy collections, or from DQL. Each time the system iterates over all of the enabled filters, adding a new piece of SQL as a filter is returned.
By adding SQL to conditional query clauses, the filtering system filters out rows belonging to entities at the SQL result set level. This means that the filtered objects are never hydrated (which can be costly).
0
source to share