1
0
mirror of synced 2024-12-14 23:26:04 +03:00

Fixed example in Establishing Associations

This commit is contained in:
Michael Ridgway 2010-09-09 10:24:10 -04:00 committed by Jonathan H. Wage
parent e342b4536a
commit 13a99c30ea

View File

@ -183,8 +183,8 @@ In the case of bi-directional associations you have to update the fields on both
$user->getAuthoredComments()->add($newComment);
$newComment->setAuthor($user);
$em->persist();
$m->flush();
$em->persist($newComment);
$em->flush();
Notice how always both sides of the bidirectional association are updated. The previous unidirectional associations were simpler to handle.