[GH-8265] Prototype for Attribute Metadata Driver#8266
[GH-8265] Prototype for Attribute Metadata Driver#8266beberlei merged 43 commits intodoctrine:2.9.xfrom
Conversation
|
There is related PR in Symfony annotations class reader. I share it here, because it might bring some inspiration or path to find united way with parsing and working with attributes for both Symfony and Dotrine.
The file https://github.com/symfony/symfony/pull/37474/files#diff-90cbecfd4505e6e8af5842db11add3b5 |
|
@TomasVotruba i don't believe it makes sense to integrate AnnotationClassLoader with attributes for more than a few simple cases, because attributes will not be 100% compatible with annotations. Tieing them together makes everything complicated instead. |
|
@beberlei Thanks for sharing. I haven't really digged into it, as the migration path is my only focus here. It would be better to comment to the author there, if you find it useful. |
b8a6a19 to
22f0353
Compare
…th test entities.
|
Good luck guys ! You rock ! |
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
|
Great work on getting native attribute support into doctrine! @beberlei we (neos/flow framework) however now suffer from a slight change in expectations for some annotation classes - namely the which now breaks, because the ManyToMany is attempted to be constructed with See neos/flow-development-collection#2487 (comment) While we can "solve" this by restricting doctrine/orm to <2.9, we would also like to move towards PHP8 support and attributes. For us the best solution would be if those three constructors would allow |
Support for Attribute Metadata Driver with PHP 8+
Note: For now the
AttributeDriverdoes not support attribute overrides, association overrides, named queries, named native queries and sql resultset mapping, because of missing nested attributes support. This is not a big problem, because these are quite edge case features some of which we have thought about removing anyways. As for the overwrites, we should think of a solution in the near future.A few other deviations from the Annotation based Driver:
@JoinTableholding join columns and inverse join columns as a property, you use#[ORM\JoinColumn]and#[ORM\InverseJoinColumn]on the top level.@Tableholding indexes and unique constraints, these are also attributes on the top level of a declaration.Todos:
Fixes #8265