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