Open tmihalicka opened 7 months ago
Works for me with FQCN. Btw may i ask why you need to specify? ORM can read the type from entity.
And it's works for you in XML becuase XSD schema is missing enum-type
for Id field?
For example this is annotation and attribute example
/**
* @ORM\Id()
* @ORM\Column(type="string", enumType=Unit::class)
*/
#[Id]
#[Column(type: 'string', enumType: Unit::class)]
public Unit $unit;
But for XML there is no way how to define enum-type
for Id field
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.
Sure i will open PR with fixed XSD mapping :)
@tmihalicka is there any news on that issue ? The xsd does not seems updated to support enum-type attribute
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.