From 9c19d1e5c4611ce744e522bb71647b2c42951bb8 Mon Sep 17 00:00:00 2001 From: HermanPeeren Date: Thu, 6 Feb 2014 15:59:56 +0100 Subject: [PATCH 1/2] 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 a762ee9ac..8f408be17 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; From 128e83909bc2b58d070a22a21235fc6acd6571d8 Mon Sep 17 00:00:00 2001 From: HermanPeeren Date: Thu, 6 Feb 2014 16:09:27 +0100 Subject: [PATCH 2/2] Update working-with-associations.rst removed some spaces that had come into it while editing last commit --- docs/en/reference/working-with-associations.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/working-with-associations.rst b/docs/en/reference/working-with-associations.rst index 8f408be17..f32ec4c4c 100644 --- a/docs/en/reference/working-with-associations.rst +++ b/docs/en/reference/working-with-associations.rst @@ -41,7 +41,7 @@ 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; @@ -49,7 +49,7 @@ information about its type and if it's the owning or inverse side. /** * Unidirectional - Many users have marked many comments as read * - * @ManyToMany(targetEntity="Comment") + * @ManyToMany(targetEntity="Comment") * @JoinTable(name="user_read_comments") */ private $commentsRead;