-
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
Auto-detect values for EnumType columns #11666
Conversation
Probably not the first PR on which I should have noted this, but should https://github.com/doctrine/orm/blob/3.2.x/docs/en/cookbook/mysql-enums.rst get modifications about this? |
30b6658
to
bb20209
Compare
Yeah, that whole page needs an overhaul now. |
bb20209
to
bf30375
Compare
Let's do this in a follow-up though. This is a larger change. |
bf30375
to
13d9de5
Compare
I've opened #11668 to track the documentation issue. |
Thank you for all your work! Great timing also as I've been looking for ways around enums the past few weeks, but now they simply work. :) |
Follow-up to #11657, leverages doctrine/dbal#6536.
This PR allows us to detect the
enumType
andoptions.values
settings for a typed property withtype: Types::ENUM
.Before:
After:
Note that the
type: Types::ENUM
part is still required if we want to have an actualENUM
column in MySQL/MariaDB. We still default toTypes::STRING
orTYPES::INTEGER
for columns types with a PHP enum as this is the more portable solution and the safer default.