Skip to content

Commit 4eb8b64

Browse files
ifdatticwouterj
authored andcommitted
Update doctrine.rst
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets |
1 parent 8b6cd17 commit 4eb8b64

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

book/doctrine.rst

+18-10
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ information. By convention, this information is usually configured in an
7777
<container xmlns="http://symfony.com/schema/dic/services"
7878
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7979
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">
8284
8385
<doctrine:config>
8486
<doctrine:dbal
@@ -165,8 +167,10 @@ for you:
165167
<container xmlns="http://symfony.com/schema/dic/services"
166168
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
167169
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">
170174
171175
<doctrine:config>
172176
<doctrine:dbal
@@ -426,6 +430,7 @@ mapping information) of a bundle or an entire namespace:
426430
427431
# generates all entities in the AppBundle
428432
$ php app/console doctrine:generate:entities AppBundle
433+
429434
# generates all entities of bundles in the Acme namespace
430435
$ php app/console doctrine:generate:entities Acme
431436
@@ -864,7 +869,7 @@ You can use this new method just like the default finder methods of the reposito
864869

865870
$em = $this->getDoctrine()->getManager();
866871
$products = $em->getRepository('AppBundle:Product')
867-
->findAllOrderedByName();
872+
->findAllOrderedByName();
868873

869874
.. note::
870875

@@ -884,7 +889,9 @@ you can let Doctrine create the class for you.
884889

885890
.. code-block:: bash
886891
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)"
888895
889896
This task generates the ``Category`` entity for you, with an ``id`` field,
890897
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
929936
products:
930937
targetEntity: Product
931938
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
933941
934942
.. code-block:: xml
935943
@@ -1038,7 +1046,7 @@ methods for you:
10381046

10391047
.. code-block:: bash
10401048
1041-
$ php app/console doctrine:generate:entities Acme
1049+
$ php app/console doctrine:generate:entities AppBundle
10421050
10431051
Ignore the Doctrine metadata for a moment. You now have two classes - ``Category``
10441052
and ``Product`` with a natural one-to-many relationship. The ``Category``
@@ -1151,7 +1159,7 @@ the category (i.e. it's "lazily loaded").
11511159

11521160
You can also query in the other direction::
11531161

1154-
public function showProductAction($id)
1162+
public function showProductsAction($id)
11551163
{
11561164
$category = $this->getDoctrine()
11571165
->getRepository('AppBundle:Category')
@@ -1372,7 +1380,7 @@ list of all available types and more information, see Doctrine's
13721380
Summary
13731381
-------
13741382

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
13761384
application and worry about database persistence second. This is because
13771385
Doctrine allows you to use any PHP object to hold your data and relies on
13781386
mapping metadata information to map an object's data to a particular database

0 commit comments

Comments
 (0)