[PR #1414] Added: A public SQLFilter Hash Function #9475

Closed
opened 2026-01-22 16:04:25 +01:00 by admin · 0 comments
Owner

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

State: closed
Merged: No


Hi

To be more flexible from a custom SQLFilter perspective, a dedicated hash function was added, which is not final and can be used by any implementing class to manipulate their e.g. caching behaviour.

The idea came from the event of having a query cache running and a filter, requiring to add actual current timestamps to the queries for comparison purposes (i.e. SoftDeleteable). As the old timestamps are cached too and the parser not fired again, old entities were returned.

As the cache id is based also on the filters hash, a quick and I think good, slick solution would be to add a Hash Function that can be manipulated by an owning filter, to handle its behaviour on its own.

It defaults back to __toString and therefore nothing changes in basics but it could be.

Cheers

Changes:

  • Added: A public SQLFilter Hash Function (defaults to __toString)
  • Changed: FilterCollection to use the newly added SQLFilter Hash Function
**Original Pull Request:** https://github.com/doctrine/orm/pull/1414 **State:** closed **Merged:** No --- Hi To be more flexible from a custom SQLFilter perspective, a dedicated hash function was added, which is not final and can be used by any implementing class to manipulate their e.g. caching behaviour. The idea came from the event of having a query cache running and a filter, requiring to add actual current timestamps to the queries for comparison purposes (i.e. SoftDeleteable). As the old timestamps are cached too and the parser not fired again, old entities were returned. As the cache id is based also on the filters hash, a quick and I think good, slick solution would be to add a Hash Function that can be manipulated by an owning filter, to handle its behaviour on its own. It defaults back to __toString and therefore nothing changes in basics but it could be. Cheers Changes: - Added: A public SQLFilter Hash Function (defaults to __toString) - Changed: FilterCollection to use the newly added SQLFilter Hash Function
admin added the pull-request label 2026-01-22 16:04:25 +01:00
admin closed this issue 2026-01-22 16:04:26 +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#9475