Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
Remove paragraph about doctrine mapping override#14152
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I don't know if we should remove this paragraph or not (some Doctrine experts will need to help us here). But if we remove it ... then we need to add some content saying that it's not possible to override that config. The current docs say "you can do XXX" ... so if it's not possible, we should say "you CANNOT do XXX" instead of deleting the original phrase. |
Because this solution only works if the bundle relies on auto_mapping. IMHO a bundle should add mapping via the dedicated compiler pass and not rely on the application configuration (`auto_mapping: true` in this case).
@javiereguiluz thank you for you feedback. I tweaked the update to underline the can/cannot idea (actually, the second paragraph explains it's possible via mapped superclasses, so I replaced "cannot" by "can only"). Now let's wait for Doctrine experts feedback :) |
Thanks Laurent! Merged. |
@javiereguiluz great :) Have you had any confirmation from a Doctrine expert ? |
I haven't, but we need to be more proactive when merging things because we have tons of pending things to do. |
Ok I understand, thank you. I tested what I wrote anyway. |
Uh oh!
There was an error while loading.Please reload this page.
Hello,
I would suggest to remove the paragraph about mapping override because it doesn't work in all cases.
I read the related PR (#10053) and the issue (#7076) which motivated it. The example in the issue works only because
auto_mapping
is set totrue
(auto_mapping: true
allows to find definitions in `Resources/config/doctrine/*.orm.{xml, yml, php} of all the bundles even if nothing is declared in the bundles).From the POV of the bundle , it's IMHO not a good practice to rely on app
auto_mapping
configuration (the trend for sf4 and sf5 is to rely on configurations over conventions).So when bundle mapping rely on the dedicated compiler pass (examplehere) and not on
auto_mapping
app configuration , the mapping definition file in the compiler pass (from the bundle) overrides the mapping definition file defined in the application.