mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Support enum-type for id field in XML mapping #7328
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tmihalicka on GitHub (Feb 20, 2024).
Bug Report
Summary
Missing support for enum-type in XML mapping
yaml, annotations and attibutes support enumType for Id field mapping but this is missing from xml mapping, and mising this option in xsd schema too.
Current behavior
It's not possible to add enum-type to XML mapping for Id field
How to reproduce
Try add enum-type to id field in xml mapping for example:
Expected behavior
Possible declare enum-type for Id field in xml mapping.
@kimhemsoe commented on GitHub (Feb 20, 2024):
Works for me with FQCN. Btw may i ask why you need to specify? ORM can read the type from entity.
@tmihalicka commented on GitHub (Feb 20, 2024):
And it's works for you in XML becuase XSD schema is missing
enum-typefor Id field?@tmihalicka commented on GitHub (Feb 20, 2024):
For example this is annotation and attribute example
But for XML there is no way how to define
enum-typefor Id field@kimhemsoe commented on GitHub (Feb 20, 2024):
Sorry miss read. Just checked xml driver and it seems to have support, but the xsd never got updated.
What you can now as a workaround is either disable xsd validation until someone makes a PR or remove the enum-type from the xml and let ORM read the type via reflection.
In your example you can remove "enumType=Unit::class" and "enumType: Unit::class" and it will work.
@tmihalicka commented on GitHub (Feb 20, 2024):
Sure i will open PR with fixed XSD mapping :)
@SmasherHell commented on GitHub (Oct 4, 2024):
@tmihalicka is there any news on that issue ? The xsd does not seems updated to support enum-type attribute
@KevinArtus commented on GitHub (Oct 25, 2024):
@tmihalicka Do you have any updates? It still doesn’t seem to work on version 3.3.0.