diff --git a/form/form_collections.rst b/form/form_collections.rst index 7922bc3f3a1..540f8d50377 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -598,12 +598,8 @@ the relationship between the removed ``Tag`` and ``Task`` object. class TaskController extends AbstractController { - public function edit($id, Request $request, EntityManagerInterface $entityManager): Response + public function edit(Task $task, Request $request, EntityManagerInterface $entityManager): Response { - if (null === $task = $entityManager->getRepository(Task::class)->find($id)) { - throw $this->createNotFoundException('No task found for id '.$id); - } - $originalTags = new ArrayCollection(); // Create an ArrayCollection of the current Tag objects in the database