@@ -15,7 +15,7 @@ There are **two** main relationship/association types:
15
15
``ManyToOne `` / ``OneToMany ``
16
16
The most common relationship, mapped in the database with a foreign
17
17
key column (e.g. a ``category_id `` column on the ``product `` table). This is
18
- actually just *one * association type, but seen from the two different *sides *
18
+ actually only *one * association type, but seen from the two different *sides *
19
19
of the relation.
20
20
21
21
``ManyToMany ``
@@ -299,7 +299,7 @@ config.
299
299
*exactly * like an array, but has some added flexibility. Just imagine that
300
300
it is an ``array `` and you'll be in good shape.
301
301
302
- Your database is setup! Now, execute the migrations like normal:
302
+ Your database is setup! Now, run the migrations like normal:
303
303
304
304
.. code-block :: terminal
305
305
@@ -374,8 +374,8 @@ Doctrine takes care of the rest when saving.
374
374
Fetching Related Objects
375
375
------------------------
376
376
377
- When you need to fetch associated objects, your workflow looks just like it
378
- did before. First, fetch a ``$product `` object and then access its related
377
+ When you need to fetch associated objects, your workflow looks like it did
378
+ before. First, fetch a ``$product `` object and then access its related
379
379
``Category `` object::
380
380
381
381
use App\Entity\Product;
@@ -395,7 +395,7 @@ did before. First, fetch a ``$product`` object and then access its related
395
395
}
396
396
397
397
In this example, you first query for a ``Product `` object based on the product's
398
- ``id ``. This issues a query for * just * the product data and hydrates the
398
+ ``id ``. This issues a query to fetch * only * the product data and hydrates the
399
399
``$product ``. Later, when you call ``$product->getCategory()->getName() ``,
400
400
Doctrine silently makes a second query to find the ``Category `` that's related
401
401
to this ``Product ``. It prepares the ``$category `` object and returns it to
@@ -493,7 +493,7 @@ This will *still* return an array of ``Product`` objects. But now, when you call
493
493
``$product->getCategory() `` and use that data, no second query is made.
494
494
495
495
Now, you can use this method in your controller to query for a ``Product ``
496
- object and its related ``Category `` with just one query::
496
+ object and its related ``Category `` in one query::
497
497
498
498
public function show($id)
499
499
{
0 commit comments