-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
To use annotations, files must be removed #6251
Conversation
I'm proposing this change after spending an hour trying to work out why my Repository class wasn't loading. Thanks to `ysor123` on IRC, we diagnosed the problem was the XML mapping files generated when reverse engineering my database, which I hadn't deleted. This is obliquely referred to at http://symfony.com/doc/current/book/doctrine.html#add-mapping-information: > A bundle can accept only one metadata definition format. For example, it's not possible to mix YAML metadata definitions with annotated PHP entity class definitions. It'd be great to clarify this for future readers.
If you want to use annotations, you must remove the XML (or YAML) files | ||
after running these two commands. It is `not possible to mix XML/YAML metadata | ||
definitions with annotated PHP entity class definitions | ||
<http://symfony.com/doc/current/book/doctrine.html#add-mapping-information>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition is nice, but we should use the ref
role to link to that section like this (I would also reword this a bit):
If you want to use annotations, you must remove the XML (or YAML) files
after running these two commands. This is necessary as
:ref:`it is not possible to mix mapping configuration formats <book-doctrine-adding-mapping>`.
this should be merged to prior branches, too what do you think @xabbuh ? |
Yes, we will do that when merging the PR. |
👍 |
Thanks @xabbuh I've updated the PR in line with your comment. |
👍 |
This PR was submitted for the 3.0 branch but it was merged into the 2.3 branch instead (closes #6251). Discussion ---------- To use annotations, files must be removed | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | Tested on 3.0 | Fixed tickets | N/A I'm proposing this change after spending an hour trying to work out why my Repository class wasn't loading. Thanks to `ysor123` on IRC, we diagnosed the problem was the XML mapping files generated when reverse engineering my database, which I hadn't deleted. This is obliquely referred to at http://symfony.com/doc/current/book/doctrine.html#add-mapping-information: > A bundle can accept only one metadata definition format. For example, it's not possible to mix YAML metadata definitions with annotated PHP entity class definitions. It'd be great to clarify this for future readers. Commits ------- 06de6c0 Updated per xabbuh's comment 6a526bf To use annotations, files must be removed
Thanks Peter! I merged this into the 2.3 branch and changed the block also to be a |
I'm proposing this change after spending an hour trying to work out why my Repository class wasn't loading.
Thanks to
ysor123
on IRC, we diagnosed the problem was the XML mapping files generated when reverse engineering my database, which I hadn't deleted.This is obliquely referred to at http://symfony.com/doc/current/book/doctrine.html#add-mapping-information:
It'd be great to clarify this for future readers.