-
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
Hydrating enumType
as array gives *string* instead of Enum
#9622
Comments
Ok, so given this some debugging and thought, this is a bit more difficult than it seemed. The reason why |
@derrabus I think that the issue here is that |
So I see the orm/lib/Doctrine/ORM/Query/SqlWalker.php Lines 1335 to 1352 in f4d5283
Now the question is - do we introduce if(!empty($fieldMapping['enumType'])) {
$this->rsm->addEnumMapping($columnAlias, $fieldMapping['enumType']);
} then when walking Or do you have another idea? Can we leverage something already present in the |
Bug Report
As discussed in original topic: #9588, but I see this as a bug as it behaves differently than any custom type. So migrating from enums used as custom types to this native form is impossible. Tested version: 2.11.2
Summary
Current behavior
Column defined as enumType gets hydrated as string when array hydration occurs.
How to reproduce
Use entity as described and fetch from query builder as array.
Expected behavior
To be hydrated as enum.
The text was updated successfully, but these errors were encountered: