8000 fixing commands in the reverse engineering example · dunglas/symfony-docs@b65fb41 · GitHub
[go: up one dir, main page]

Skip to content

Commit b65fb41

Browse files
committed
fixing commands in the reverse engineering example
1 parent 31443a3 commit b65fb41

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 metadata class in YAML format by changing the
73-
first argument to ``yml``.
72+
It's also possible to generate the metadata files 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-mapping xmlns="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-
<entity name="BlogPost" table="blog_post">
81+
<entity name="Acme\BlogBundle\Entity\BlogPost" table="blog_post">
8282
<id name="id" type="bigint" column="id">
8383
<generator strategy="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-
<entity name="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 with an annotations mapping. But
99+
The first command generates entity classes with annotation 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 XML files after
113-
running these two commands.
105+
If you want to use annotations, you can safely delete the XML (or YAML) files
106+
after running these two commands.
114107

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

0 commit comments

Comments
 (0)
0