mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
automatic discriminator discovery not namespace aware #5997
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @delboy1978uk on GitHub (Jun 22, 2018).
Originally assigned to: @Majkl578 on GitHub.
Bug Report
Summary
Current behavior
Right now there has been one PR closed, and 2 still open for a
@DiscriminatorValuesince the entire discriminator map currently needs to go into the base class, which means extending classes in a different package will not work with it.Currently we have an automatic discriminator map, just by removing the annotation. However, two classes with the same name regardless of the namespace will not work.
How to reproduce
then try and extend it with another User class in a different namespace:
Expected behavior
Migrations will generate.
@delboy1978uk commented on GitHub (Jun 25, 2018):
In the meantime, I have just renamed my second user class to OAuthUser. Not ideal but it works.
@Majkl578 commented on GitHub (Jul 3, 2018):
Unfortunately this can't be changed in BC way so it will have to stay as is in ORM 2.x.
We may deprecate auto-discovery in 3.0 and replace it by
@DiscriminatorValue, probably via #6612.I'll leave it open, but there's nothing we can do in 2.x in this regard.
@delboy1978uk commented on GitHub (Jul 5, 2018):
I thought that might be the case, thanks for letting me know!