@@ -56,11 +56,11 @@ folder.
5656The first step towards building entity classes from an existing database
5757is to ask Doctrine to introspect the database and generate the corresponding
5858metadata 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
6666the 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 generatethe metadatafiles in YAML format by changing
73+ the last argument to ``yml ``.
7474
7575The 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
9992entity 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
107100if you want to use yml or xml mapping instead of annotations, you should
108101execute 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+ after running these two commands.
114107
115108For example, the newly created ``BlogComment `` entity class looks as follow::
116109