1
0
mirror of synced 2025-01-07 09:37:11 +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); $user->getAuthoredComments()->add($newComment);
$newComment->setAuthor($user); $newComment->setAuthor($user);
$em->persist(); $em->persist($newComment);
$m->flush(); $em->flush();
Notice how always both sides of the bidirectional association are updated. The previous unidirectional associations were simpler to handle. Notice how always both sides of the bidirectional association are updated. The previous unidirectional associations were simpler to handle.