-
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
Updated the test case for DDC6558 after review comments #6578
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
Conversation
@jeroenvrooij @Ocramius I'd close this one as |
@lcobucci what do you mean with 'is not mapped'? I added the '@entity' annotation. In the original PR I also added the inheritance annotations to the Employee, but that lead to other issues and @Ocramius noted that that was an invalid mapping. See #6558 for some background info and a link to the other PR. If you think multilevel inheritance is working properly can you please show me a brief example? We'd love to work with it, but we cannot find any docs or anybody to tell us how to do it. The implementations we tried for ourselves all had their flaws (hence the created issue ;)) |
@jeroenvrooij it's not mapped as a discriminator. I've made your tests pass by adding it there. |
@jeroenvrooij that's not what I meant, that specific class is not listed in your discriminator map (at the root class). I'm replying from my mobile so it's quite difficult to send you snippets, however if you just add that class to your map the test will pass. |
I'm now on my laptop... this makes your tests to pass: /**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"manager" = "DDC6558Manager", "staff" = "DDC6558Staff", "developer" = "DDC6558Developer", "employee" = "DDC6558Employee"})
*/
abstract class DDC6558Person
{
/** @Id @Column(type="integer") @GeneratedValue */
public $id;
} Note that I've added |
@lcobucci Thanks for the explanation, I now get what you mean :). And indeed: if I add the employee in the discriminator map of the root class then the test passes. At the moment I cannot quickly test it in our application because we already re-structured the design (we could not wait any longer). But I think that all scenarios (persisting, fetching, etc) will now work, awesome! (You could even add We really struggled to get this set up, mainly because it is not in the Doctrine docs and we couldn't find any conclusive info on the web. I cannot imagine that we are the only ones facing this, so would this be something that should be added to the docs? If so, I would love to help making that happen :). |
@jeroenvrooij rather than documentation, this should be part of the schema validation tools. The validator should have a piece of logic dedicated to detecting problems in the |
…d in discriminator.
…d in discriminator.
No description provided.