-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDC-2772: One class can be mapped to multiple discriminator values #3519
Comments
Our intended solution is 1. "Enforce a strict one-to-one relationship between value and class. This means I would have to modify my code to reflect this." An enforcement should be added restricting people to map multiple discriminator values to a single class. This should be done at mapping level by checking |
This makes sense for ORM 3.0 but also requires a deprecation message to be thrown in 2.x |
Do you want to work on it? 🙃 |
…criminator values.
…criminator values.
Hello, (The example is very basic but I have some entity that works thay way) Thanks |
@javijavo but there is no way to new Mamal() and have it stored as either dog or cat. Do you create these entities outside the ORM? |
I have a very old and huge legacy application progressively adating it to Doctrine and yes the data is already stored. But I see the problem of having multiple values, didn't have in mind the "standard" scenario instead my ugly one. Thanks |
…criminator values.
…criminator values.
[GH-3519] Deprecate passing the same class with different discriminator values.
Jira issue originally created by user mouyang:
I'm not sure if this is intentional or not, but this appears to a valid discriminator map. The problem I am running into is that it's impossible to create an instance of ClassB with a discriminator value "DiscB" (it's always "DiscC" - I'm assuming last one wins here).
Eventhough DiscB and DiscC map to the same class, I do want to maintain some sort of logical separation in the database using the two discriminator values. That does not appear to be possible. I can provide more details about my data model, if necessary.
These are the possible solutions I can think of.
The text was updated successfully, but these errors were encountered: