From 7c168c20474b48eb724d019cba70dd0ee783c6bd Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 9 Jan 2017 14:07:17 +0100 Subject: [PATCH] Update working-with-associations.rst As requested: https://github.com/doctrine/doctrine2/pull/6171#pullrequestreview-15695400 --- docs/en/reference/working-with-associations.rst | 1 + 1 file changed, 1 insertion(+) 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();