mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
MappingException with report_fields_where_declared: true #7287
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 @BackNot on GitHub (Dec 20, 2023).
Bug Report
Summary
With the option report_fields_where_declared I get error
Reproduce
I updated the doctrine recipe and set this option to true:
I have the following class hierarchy:
I understand that with this setting if I have the property "id" both in my parent and child the error will be shown. But currently I just inherit it and I do not overwrite it anywhere.
If I drop class C and put this field in class B this error is not triggered.
@derrabus commented on GitHub (Dec 20, 2023):
cc @mpdude
@mpdude commented on GitHub (Dec 21, 2023):
The C class contains mapping information but is not an entity nor a mapped superclass. Is that correct?
@mpdude commented on GitHub (Dec 21, 2023):
Also, you’re relying on an autogenerated discriminator map?
@BackNot commented on GitHub (Dec 22, 2023):
Yes, to both questions.
@mpdude commented on GitHub (Dec 22, 2023):
Are you aware that this is not a supported way of configuration?
Out of curiosity, may I ask why you’re doing it that way?
@BackNot commented on GitHub (Dec 22, 2023):
I didn't know that it was not supported. I have entities that have the same set of 3-4 properties and schema and I thought that I can reuse it. Thanks for the info.
@mpdude commented on GitHub (Dec 22, 2023):
Maybe a mapped superclass helps?
@mpdude commented on GitHub (Dec 22, 2023):
See the second yellow box at https://www.doctrine-project.org/projects/doctrine-orm/en/2.17/reference/inheritance-mapping.html#inheritance-mapping
@BackNot commented on GitHub (Dec 27, 2023):
I can confirm that mapped superclass solved my problem. I am going to close the issue.