[PR #9523] Bring FilterCollection to a "clean" state after hash computation #11679

Open
opened 2026-01-22 16:11:34 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/9523

State: closed
Merged: Yes


Improvement

Q A
New Feature no
RFC no
BC Break no

Effectively, the FilterCollection was never brought back into a "clean" state after filters were enabled or filter parameters were set.

As far as I can tell, the clean/dirty distinction only refers to the computed FilterCollection hash reflecting all enabled filters and their parameters.

The only place I could find where the distinction matters is here:

152c04c03d/lib/Doctrine/ORM/Query.php (L241-L259)

When the filter collection is dirty and the query cache is used, the call to getQueryCacheId() in the last line shown will reset the filter collection to a clean state.

When there is no query cache, however, getQueryCacheId() is not called and the FilterCollection will not revert to a clean state; this prevents re-using the query later on.

If desired, I could add a FilterCollection::setFiltersStateClean() method to improve this case as well.

Closes #9521

**Original Pull Request:** https://github.com/doctrine/orm/pull/9523 **State:** closed **Merged:** Yes --- ### Improvement | Q | A |------------ | ------ | New Feature | no | RFC | no | BC Break | no Effectively, the `FilterCollection` was never brought back into a "clean" state after filters were enabled or filter parameters were set. As far as I can tell, the clean/dirty distinction only refers to the computed FilterCollection hash reflecting all enabled filters and their parameters. The only place I could find where the distinction matters is here: https://github.com/doctrine/orm/blob/152c04c03d68d39f485d367713dd69dec0f4106d/lib/Doctrine/ORM/Query.php#L241-L259 When the filter collection is dirty and the query cache is used, the call to `getQueryCacheId()` in the last line shown will reset the filter collection to a `clean` state. When there is no query cache, however, `getQueryCacheId()` is not called and the `FilterCollection` will not revert to a clean state; this prevents re-using the query later on. If desired, I could add a `FilterCollection::setFiltersStateClean()` method to improve this case as well. Closes #9521
admin added the pull-request label 2026-01-22 16:11:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11679