Skip to content

Commit 1db4f19

Browse files
committed
[Doctrine] fixed getManager in repository
1 parent 7ae5983 commit 1db4f19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

book/doctrine.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,15 +744,15 @@ ordered alphabetically.
744744
{
745745
public function findAllOrderedByName()
746746
{
747-
return $this->getManager()
747+
return $this->getEntityManager()
748748
->createQuery('SELECT p FROM AcmeStoreBundle:Product p ORDER BY p.name ASC')
749749
->getResult();
750750
}
751751
}
752752
753753
.. tip::
754754

755-
The entity manager can be accessed via ``$this->getManager()``
755+
The entity manager can be accessed via ``$this->getEntityManager()``
756756
from inside the repository.
757757

758758
You can use this new method just like the default finder methods of the repository::
@@ -1065,7 +1065,7 @@ following method to the ``ProductRepository`` class::
10651065
// src/Acme/StoreBundle/Repository/ProductRepository.php
10661066
public function findOneByIdJoinedToCategory($id)
10671067
{
1068-
$query = $this->getManager()
1068+
$query = $this->getEntityManager()
10691069
->createQuery('
10701070
SELECT p, c FROM AcmeStoreBundle:Product p
10711071
JOIN p.category c

0 commit comments

Comments
 (0)