From 9c19d1e5c4611ce744e522bb71647b2c42951bb8 Mon Sep 17 00:00:00 2001 From: HermanPeeren Date: Thu, 6 Feb 2014 15:59:56 +0100 Subject: [PATCH] Update working-with-associations.rst There are 2 many-to-many associations between the users and comments. Both use another join-table. The join-tables user_favorite_comments and user_read_comments must be specified. Otherwise the default "user_comment" is taken twice. See https://groups.google.com/forum/#!topic/doctrine-user/Kti36_n6490 and https://groups.google.com/forum/#!topic/doctrine-user/TYwafhgYiSU --- docs/en/reference/working-with-associations.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/working-with-associations.rst b/docs/en/reference/working-with-associations.rst index a762ee9ac35..8f408be179f 100644 --- a/docs/en/reference/working-with-associations.rst +++ b/docs/en/reference/working-with-associations.rst @@ -41,14 +41,16 @@ information about its type and if it's the owning or inverse side. /** * Bidirectional - Many users have Many favorite comments (OWNING SIDE) * - * @ManyToMany(targetEntity="Comment", inversedBy="userFavorites") + * @ManyToMany(targetEntity="Comment", inversedBy="userFavorites") + * @JoinTable(name="user_favorite_comments") */ private $favorites; /** * Unidirectional - Many users have marked many comments as read * - * @ManyToMany(targetEntity="Comment") + * @ManyToMany(targetEntity="Comment") + * @JoinTable(name="user_read_comments") */ private $commentsRead;