Skip to content

Explain another option to override bundle's entity mapping #10053

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

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

javiereguiluz
Copy link
Member

Fixes #7076 ... but it needs validation from a Doctrine expert.

@javiereguiluz javiereguiluz added this to the 2.8 milestone Jul 12, 2018
Copy link
Contributor

@jwage jwage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is accurate as far as I know.

@javiereguiluz
Copy link
Member Author

@jwage thanks for the review!

@javiereguiluz javiereguiluz merged commit a758b4f into symfony:2.8 Jul 25, 2018
javiereguiluz added a commit that referenced this pull request Jul 25, 2018
…ng (javiereguiluz)

This PR was merged into the 2.8 branch.

Discussion
----------

Explain another option to override bundle's entity mapping

Fixes #7076 ... but it needs validation from a Doctrine expert.

Commits
-------

a758b4f Explain another option to override bundle's entity mapping
javiereguiluz added a commit that referenced this pull request Sep 7, 2020
This PR was merged into the 3.4 branch.

Discussion
----------

Remove paragraph about doctrine mapping override

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 to `true` (`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 (example [here](https://github.com/FriendsOfSymfony/FOSUserBundle/blob/cf7fe27b2f4e1f298ee6eadf537267f8c9f9b85c/FOSUserBundle.php#L50)) 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.

Commits
-------

49eca77 Remove paragraph about mapping override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants