-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add enum reflection property #248
Conversation
2b17ff7
to
ac1f5fb
Compare
tests/Doctrine/Tests_PHP81/Persistence/Reflection/EnumReflectionPropertyTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/Tests_PHP81/Persistence/Reflection/EnumReflectionPropertyTest.php
Show resolved
Hide resolved
I think you mean |
I'd say |
@malarzm I wasn't worried so much about preserving the type, which wouldn't even be achieved by my proposal, as about preserving the extra context that is added:
If you have many entities/document using the same enum, and your database/document store contains an invalid value for that enum somewhere, it might help to know where.
|
We'll totally do what you're proposing, but on ODM's level. I'm not sure how much value the exception will bring in this case. For instance in ODM the |
Thanks @IonBazan ! |
Reduces code duplication in doctrine/mongodb-odm#2412 and doctrine/orm#9304 by extracting the
EnumReflectionProperty
here. Please take note of slightly changed name and throwing nativeValueException
here instead ofMappingException
.