diff --git a/docs/en/reference/working-with-associations.rst b/docs/en/reference/working-with-associations.rst index d1d7b4265..e3a148913 100644 --- a/docs/en/reference/working-with-associations.rst +++ b/docs/en/reference/working-with-associations.rst @@ -495,6 +495,7 @@ association, you can now create a user and persist their comments as follows: $user = new User(); $myFirstComment = new Comment(); $user->addComment($myFirstComment); + $myFirstComment->setUser($user); $em->persist($user); $em->flush();