Skip to content

Commit 42c038a

Browse files
committed
minor #8949 Update doctrine.rst (MarcusSchwarz)
This PR was merged into the 4.0 branch. Discussion ---------- Update doctrine.rst Fixes two minor issues in code examples Commits ------- 4e10bdd Update doctrine.rst
2 parents b3f121e + 4e10bdd commit 42c038a

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)