File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Original file line number Diff line number Diff line change @@ -632,6 +632,9 @@ Updating an Object
632
632
Once you've fetched an object from Doctrine, updating it is easy. Suppose
633
633
you have a route that maps a product id to an update action in a controller::
634
634
635
+ use AppBundle\Entity\Post;
636
+ // ...
637
+
635
638
public function updateAction($productId)
636
639
{
637
640
$em = $this->getDoctrine()->getManager();
Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ When you need to fetch associated objects, your workflow looks just like it
273
273
did before. First, fetch a ``$product `` object and then access its related
274
274
``Category `` object::
275
275
276
+ use AppBundle\Entity\Post;
277
+ // ...
278
+
276
279
public function showAction($productId)
277
280
{
278
281
$product = $this->getDoctrine()
Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ entities, ordered alphabetically by name.
86
86
87
87
You can use this new method just like the default finder methods of the repository::
88
88
89
+ use AppBundle\Entity\Post;
90
+ // ...
91
+
89
92
$em = $this->getDoctrine()->getManager();
90
93
$products = $em->getRepository(Product::class)
91
94
->findAllOrderedByName();
You can’t perform that action at this time.
0 commit comments