mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #9523] Bring FilterCollection to a "clean" state after hash computation
#11679
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?
Original Pull Request: https://github.com/doctrine/orm/pull/9523
State: closed
Merged: Yes
Improvement
Effectively, the
FilterCollectionwas 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 acleanstate.When there is no query cache, however,
getQueryCacheId()is not called and theFilterCollectionwill 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