Open GromNaN opened 3 months ago
Sounds useful and I think ORM had it for a while now. Do you mind if I try to implement this one if you haven't started yet? Otherwise, let me know if you need any help.
@IonBazan I haven't started investigating yet. Do so if you feel inspired.
We already have that thanks to #2411 and @franmomu :)
We already have that thanks to #2411 and @franmomu :)
Perfect. How could I have missed it despite it being well documented? I may simplify some doc examples to leverage this feature.
One thing that could be improved is reading the phpdoc for @var Collection<Class>
annotation that would indicate the targetDocument
of #[EmbedMany]
and #[ReferenceMany]
. As long as we don't have a native PHP solution for generics.
Thanks @malarzm, looks like I forgot about this feature. Perhaps it could be extracted to a separate class as ClassMetadata
is already massive. We could also port https://github.com/doctrine/orm/pull/10313 which allows customization of this functionality.
Feature Request
Summary
In metadata, the default type of fields is
string
, regardless of the type of field property. I propose to inspect the property types when the field type is not defined. The would only support simple types (maybe with extension point):Benefit: no need to declare the field type.
Usage