Open NoiseByNorthwest opened 11 years ago
Ok, I understand. Unfortunately there is no hydration mechanism for resolving discriminatormap from subclasses' discriminatorvalue, and it would be a really great feature.
That was my original intent, but I never got around to hooking it all up. I think we need something that will build all the discriminator values from child classes and store it in the metadata.
Well, this seems a very interesting feature. I have an inheritance structure that has currently approximately ~50 different subclasses and the annotation in the superclass is getting ugly.
It would be excellent if this would work also with @EmbedMany
/ @EmbedOne
inheritance. Currently if we are using a certain embedded document classes in multiple documents, each of the main document needs to duplicate the @DiscriminatorMap
value in the field definition. This @DiscriminatorValue
would most propably work there well.
Closing: this has long been implemented and working.
It is still undocumebted tho, reopening and retriaging
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.
Bad bot...
It chains to
ClassMetadataInfo::setDiscriminatorValue()
, which appears to set the current class in the map with the given value as its key.I don't have any information beyond that, but I was able to trace it to @jwage's original commit in https://github.com/doctrine/mongodb-odm/commit/4cdacfb64f339ae286c6aab078c160422f693781.