Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02c73c2

Browse files
committed
Merge pull requestsymfony#2578 from 77web/fix-reverse_engineering-doc
[cookbook][doctrine] fixed reverse_engineering doc
2 parents6a36993 +43b5306 commit02c73c2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎cookbook/doctrine/reverse_engineering.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ tables fields.
6060

6161
..code-block::bash
6262
63-
$ php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force
63+
$ php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine --from-database --force
6464
6565
This command line tool asks Doctrine to introspect the database and generate
66-
the XML metadata files under the ``src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm``
66+
the XML metadata files under the ``src/Acme/BlogBundle/Resources/config/doctrine``
6767
folder of your bundle.
6868

6969
..tip::
7070

7171
It's also possible to generate metadata class in YAML format by changing the
7272
first argument to `yml`.
7373

74-
The generated ``BlogPost.dcm.xml`` metadata file looks as follows:
74+
The generated ``BlogPost.orm.xml`` metadata file looks as follows:
7575

7676
..code-block::xml
7777
@@ -92,23 +92,27 @@ The generated ``BlogPost.dcm.xml`` metadata file looks as follows:
9292
</entity>
9393
</doctrine-mapping>
9494
95+
Then you should insert proper namespace in ``name`` attribute of ``entity`` element like this:
96+
97+
..code-block::xml
98+
99+
<entityname="Acme\BlogBundle\BlogPost"table="blog_post">
100+
95101
..note::
96102

97103
If you have ``oneToMany`` relationships between your entities,
98104
you will need to edit the generated ``xml`` or ``yml`` files to add
99105
a section on the specific entities for ``oneToMany`` defining the
100106
``inversedBy`` and the ``mappedBy`` pieces.
101107

102-
Once the metadata files are generated, you can ask Doctrine to import the
103-
schema and build related entity classes by executing the following two commands.
108+
Once the metadata files are generated, you can ask Doctrine to build related entity classes by executing the following two commands.
104109

105110
..code-block::bash
106111
107-
$ php app/console doctrine:mapping:import AcmeBlogBundleannotation
112+
$ php app/console doctrine:mapping:convertannotation ./src
108113
$ php app/console doctrine:generate:entities AcmeBlogBundle
109114
110-
The first command generates entity classes with an annotations mapping, but
111-
you can of course change the ``annotation`` argument to ``xml`` or ``yml``.
115+
The first command generates entity classes with an annotations mapping. But if you want to use yml or xml mapping instead of annotations, you should execute the second command only.
112116
The newly created ``BlogComment`` entity class looks as follow:
113117

114118
..code-block::php

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp