Skip to content

Commit 6a526bf

Browse files
pbowyerweaverryan
authored andcommitted
To use annotations, files must be removed
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.
1 parent 68cdbee commit 6a526bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cookbook/doctrine/reverse_engineering.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ execute the second command only.
101101

102102
.. tip::
103103

104-
If you want to use annotations, you can safely delete the XML (or YAML) files
105-
after running these two commands.
104+
If you want to use annotations, you must remove the XML (or YAML) files
105+
after running these two commands. It is `not possible to mix XML/YAML metadata
106+
definitions with annotated PHP entity class definitions
107+
<http://symfony.com/doc/current/book/doctrine.html#add-mapping-information>`_.
106108

107109
For example, the newly created ``BlogComment`` entity class looks as follow::
108110

0 commit comments

Comments
 (0)