@@ -316,7 +316,7 @@ You can also query in the other direction::
316
316
317
317
In this case, the same things occur: you first query out for a single ``Category ``
318
318
object, and then Doctrine makes a second query to retrieve the related ``Product ``
319
- objects, but only once/if you ask for them (i.e. when you call ``-> getProducts() ``).
319
+ objects, but only once/if you ask for them (i.e. when you call ``getProducts() ``).
320
320
The ``$products `` variable is an array of all ``Product `` objects that relate
321
321
to the given ``Category `` object via their ``category_id `` value.
322
322
@@ -365,7 +365,7 @@ Of course, if you know up front that you'll need to access both objects, you
365
365
can avoid the second query by issuing a join in the original query. Add the
366
366
following method to the ``ProductRepository `` class::
367
367
368
- // src/AppBundle/Entity /ProductRepository.php
368
+ // src/AppBundle/Repository /ProductRepository.php
369
369
public function findOneByIdJoinedToCategory($productId)
370
370
{
371
371
$query = $this->getEntityManager()
@@ -407,7 +407,7 @@ Doctrine's `Association Mapping Documentation`_.
407
407
.. note ::
408
408
409
409
If you're using annotations, you'll need to prepend all annotations with
410
- ``ORM\ `` (e.g. ``ORM\OneToMany ``), which is not reflected in Doctrine's
410
+ ``@ ORM\ `` (e.g. ``@ ORM\OneToMany ``), which is not reflected in Doctrine's
411
411
documentation. You'll also need to include the ``use Doctrine\ORM\Mapping as ORM; ``
412
412
statement, which *imports * the ``ORM `` annotations prefix.
413
413
0 commit comments