[PR #11895] Fix IN/NOT IN expression handling and support enums when matching on to-many-collections #13320

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

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

State: closed
Merged: Yes


This fixes that using a Criteria with an IN or NIN expression on a many-to-many collection currently leads to an SQL error (#6173). The ManyToMany persister needs to know about the slightly different SQL syntax for [NOT] IN ().

In the case of [NOT] IN expressions, the value will be an array, which also required me to change (fix?) the parameter type handling. I have pulled the necessary code from the BasicEntityPersister and placed it as static helper methods in PersisterHelper.

This is somewhat inspired by #11516, which aims at fixing #11481: By re-using the parameter type handling code, it also fixes using backed enums in EQ, IN and NIN expressions within Criteria when matching() on one-to-many and many-to-many collections.

Fixes #6173, fixes #11031, fixes #11481, closes #11516.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11895 **State:** closed **Merged:** Yes --- This fixes that using a `Criteria` with an `IN` or `NIN` expression on a many-to-many collection currently leads to an SQL error (#6173). The `ManyToMany` persister needs to know about the slightly different SQL syntax for `[NOT] IN ()`. In the case of `[NOT] IN` expressions, the value will be an array, which also required me to change (fix?) the parameter type handling. I have pulled the necessary code from the `BasicEntityPersister` and placed it as static helper methods in `PersisterHelper`. This is somewhat inspired by #11516, which aims at fixing #11481: By re-using the parameter type handling code, it also fixes using backed enums in `EQ`, `IN` and `NIN` expressions within `Criteria` when `matching()` on one-to-many and many-to-many collections. Fixes #6173, fixes #11031, fixes #11481, closes #11516.
admin added the pull-request label 2026-01-22 16:16:48 +01:00
admin closed this issue 2026-01-22 16:16:49 +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#13320