From 4e10bdd514ae2b713ea05a29cfac3d426d0799cf Mon Sep 17 00:00:00 2001 From: Marcus Schwarz Date: Sun, 31 Dec 2017 22:43:17 +0100 Subject: [PATCH] Update doctrine.rst Fixes two minor issues in code examples --- doctrine.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doctrine.rst b/doctrine.rst index 8cb46abc5f2..a0b90f25ade 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -623,7 +623,7 @@ a new method for this to your repository:: return $qb->execute(); // to get just one result: - // $product = $query->setMaxResults(1)->getOneOrNullResult(); + // $product = $qb->setMaxResults(1)->getOneOrNullResult(); } } @@ -654,6 +654,8 @@ In addition to the query builder, you can also query with `Doctrine Query Langua public function findAllGreaterThanPrice($price): array { + $em = $this->getEntityManager(); + $query = $em->createQuery( 'SELECT p FROM App\Entity\Product p