Skip to content

Commit 4e10bdd

Browse files
Update doctrine.rst
Fixes two minor issues in code examples
1 parent 967ee2a commit 4e10bdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doctrine.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ a new method for this to your repository::
623623
return $qb->execute();
624624

625625
// to get just one result:
626-
// $product = $query->setMaxResults(1)->getOneOrNullResult();
626+
// $product = $qb->setMaxResults(1)->getOneOrNullResult();
627627
}
628628
}
629629

@@ -654,6 +654,8 @@ In addition to the query builder, you can also query with `Doctrine Query Langua
654654

655655
public function findAllGreaterThanPrice($price): array
656656
{
657+
$em = $this->getEntityManager();
658+
657659
$query = $em->createQuery(
658660
'SELECT p
659661
FROM App\Entity\Product p

0 commit comments

Comments
 (0)