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

Commit3980b0b

Browse files
committed
Merge pull request#2873 from xabbuh/issue-2868
fixing commands in the reverse engineering example
2 parents56b6b25 +b65fb41 commit3980b0b

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

‎cookbook/doctrine/reverse_engineering.rst

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ folder.
5656
The first step towards building entity classes from an existing database
5757
is to ask Doctrine to introspect the database and generate the corresponding
5858
metadata files. Metadata files describe the entity class to generate based on
59-
tables fields.
59+
table fields.
6060

6161
..code-block::bash
6262
63-
$ php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine --from-database --force
63+
$ php app/console doctrine:mapping:import --force AcmeBlogBundle xml
6464
6565
This command line tool asks Doctrine to introspect the database and generate
6666
the XML metadata files under the ``src/Acme/BlogBundle/Resources/config/doctrine``
@@ -69,16 +69,16 @@ folder of your bundle. This generates two files: ``BlogPost.orm.xml`` and
6969

7070
..tip::
7171

72-
It's also possible to generate metadataclass in YAML format by changing the
73-
first argument to ``yml``.
72+
It's also possible to generatethemetadatafiles in YAML format by changing
73+
the last argument to ``yml``.
7474

7575
The generated ``BlogPost.orm.xml`` metadata file looks as follows:
7676

7777
..code-block::xml
7878
7979
<?xml version="1.0" encoding="utf-8"?>
8080
<doctrine-mappingxmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
81-
<entityname="BlogPost"table="blog_post">
81+
<entityname="Acme\BlogBundle\Entity\BlogPost"table="blog_post">
8282
<idname="id"type="bigint"column="id">
8383
<generatorstrategy="IDENTITY"/>
8484
</id>
@@ -88,13 +88,6 @@ The generated ``BlogPost.orm.xml`` metadata file looks as follows:
8888
</entity>
8989
</doctrine-mapping>
9090
91-
Update the namespace in the ``name`` attribute of the ``entity`` element like
92-
this:
93-
94-
..code-block::xml
95-
96-
<entityname="Acme\BlogBundle\Entity\BlogPost"table="blog_post">
97-
9891
Once the metadata files are generated, you can ask Doctrine to build related
9992
entity classes by executing the following two commands.
10093

@@ -103,14 +96,14 @@ entity classes by executing the following two commands.
10396
$ php app/console doctrine:mapping:convert annotation ./src
10497
$ php app/console doctrine:generate:entities AcmeBlogBundle
10598
106-
The first command generates entity classes withan annotations mapping. But
99+
The first command generates entity classes withannotation mappings. But
107100
if you want to use yml or xml mapping instead of annotations, you should
108101
execute the second command only.
109102

110103
..tip::
111104

112-
If you want to use annotations, you can safely delete the XMLfiles after
113-
running these two commands.
105+
If you want to use annotations, you can safely delete the XML(or YAML) files
106+
afterrunning these two commands.
114107

115108
For example, the newly created ``BlogComment`` entity class looks as follow::
116109

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp