@@ -77,8 +77,10 @@ information. By convention, this information is usually configured in an
77
77
<container xmlns =" http://symfony.com/schema/dic/services"
78
78
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
79
79
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine"
80
- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
81
- http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
80
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
81
+ http://symfony.com/schema/dic/services/services-1.0.xsd
82
+ http://symfony.com/schema/dic/doctrine
83
+ http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
82
84
83
85
<doctrine : config >
84
86
<doctrine : dbal
@@ -165,8 +167,10 @@ for you:
165
167
<container xmlns =" http://symfony.com/schema/dic/services"
166
168
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
167
169
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine"
168
- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
169
- http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
170
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
171
+ http://symfony.com/schema/dic/services/services-1.0.xsd
172
+ http://symfony.com/schema/dic/doctrine
173
+ http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
170
174
171
175
<doctrine : config >
172
176
<doctrine : dbal
@@ -426,6 +430,7 @@ mapping information) of a bundle or an entire namespace:
426
430
427
431
# generates all entities in the AppBundle
428
432
$ php app/console doctrine:generate:entities AppBundle
433
+
429
434
# generates all entities of bundles in the Acme namespace
430
435
$ php app/console doctrine:generate:entities Acme
431
436
@@ -864,7 +869,7 @@ You can use this new method just like the default finder methods of the reposito
864
869
865
870
$em = $this->getDoctrine()->getManager();
866
871
$products = $em->getRepository('AppBundle:Product')
867
- ->findAllOrderedByName();
872
+ ->findAllOrderedByName();
868
873
869
874
.. note ::
870
875
@@ -884,7 +889,9 @@ you can let Doctrine create the class for you.
884
889
885
890
.. code-block :: bash
886
891
887
- $ php app/console doctrine:generate:entity --entity=" AppBundle:Category" --fields=" name:string(255)"
892
+ $ php app/console doctrine:generate:entity \
893
+ --entity=" AppBundle:Category" \
894
+ --fields=" name:string(255)"
888
895
889
896
This task generates the ``Category `` entity for you, with an ``id `` field,
890
897
a ``name `` field and the associated getter and setter functions.
@@ -929,7 +936,8 @@ To relate the ``Category`` and ``Product`` entities, start by creating a
929
936
products :
930
937
targetEntity : Product
931
938
mappedBy : category
932
- # don't forget to init the collection in the __construct() method of the entity
939
+ # don't forget to init the collection in the __construct() method
940
+ # of the entity
933
941
934
942
.. code-block :: xml
935
943
@@ -1038,7 +1046,7 @@ methods for you:
1038
1046
1039
1047
.. code-block :: bash
1040
1048
1041
- $ php app/console doctrine:generate:entities Acme
1049
+ $ php app/console doctrine:generate:entities AppBundle
1042
1050
1043
1051
Ignore the Doctrine metadata for a moment. You now have two classes - ``Category ``
1044
1052
and ``Product `` with a natural one-to-many relationship. The ``Category ``
@@ -1151,7 +1159,7 @@ the category (i.e. it's "lazily loaded").
1151
1159
1152
1160
You can also query in the other direction::
1153
1161
1154
- public function showProductAction ($id)
1162
+ public function showProductsAction ($id)
1155
1163
{
1156
1164
$category = $this->getDoctrine()
1157
1165
->getRepository('AppBundle:Category')
@@ -1372,7 +1380,7 @@ list of all available types and more information, see Doctrine's
1372
1380
Summary
1373
1381
-------
1374
1382
1375
- With Doctrine, you can focus on your objects and how they're useful in your
1383
+ With Doctrine, you can focus on your objects and how they're used in your
1376
1384
application and worry about database persistence second. This is because
1377
1385
Doctrine allows you to use any PHP object to hold your data and relies on
1378
1386
mapping metadata information to map an object's data to a particular database
0 commit comments