Skip to content

Conversation

@kitsunet
Copy link
Member

This change allows to use the enumType property for a Column attribute and thus use enums as types in entities with the mapping being handled by doctrine ORM. The special case for the "type" is no longer needed as it has been nullable in the attribute/annotation for some years now, so we can rely on a default null if you didn't configure the type, and therefore triggering our auto detection in this case. We need this special case removed to allow string backed enums to be mapped correctly, as we need to fix the type to string and bypass auto detection.

In 8.3 we could remove the special handling for type already, but enumType was not available in the lowest accepted ORM version, therefore I targeted 8.4 as the required ORM version contains enumType.

This change allows to use the enumType property for a `Column` attribute and thus use enums as types in entities with the mapping being handled by doctrine ORM.
The special case for the "type" is no longer needed as it has been nullable in the attribute/annotation for some years now, so we can rely on a default null if you didn't configure the type, and therefore triggering our auto detection in this case. We need this special case removed to allow string backed enums to be mapped correctly, as we need to fix the type to string and bypass auto detection.
@kitsunet
Copy link
Member Author

Probably should add a behat test with an enum in an entity

Copy link
Contributor

@dlubitz dlubitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@kitsunet
Copy link
Member Author

Well behat in Flow still needs a major refactoring so functional test it is...

@kitsunet kitsunet merged commit bf3ea1a into 8.4 Jan 22, 2026
10 checks passed
@kitsunet kitsunet deleted the bugfix/enums-in-orm branch January 22, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants