-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Criteria with enums to filter lazy loaded collections #11481
Comments
I found a "workaround" in order to make it work: I set the fetch mode to 'EAGER'. This way, the collection is always initialized and the comparison with the enum works. In my case, it's still acceptable since I don't have too many records to load. |
For anyone wanting to help on that, the support of enum values need to be added in |
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 21, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 21, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 21, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 21, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 24, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Jun 24, 2024
kira0269
pushed a commit
to kira0269/orm
that referenced
this issue
Aug 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
Working with enums in matching criteria for collections does not work correctly for bot lazy and eager loading.
Current behavior
When filtering collections with
$collection->matching($criteria)
, if the collection is not initialized, the values from the criteria object won't be converted to database types. So\BackedEnum
s are not replaced by their scalar value.How to reproduce
There is the stack trace:
Expected behavior
I expect the same behavior between the two cases.
The text was updated successfully, but these errors were encountered: