Skip to content

Commit

Permalink
Update working-with-associations.rst
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HermanPeeren committed Feb 6, 2014
1 parent 626efda commit 9c19d1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/en/reference/working-with-associations.rst
Expand Up @@ -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;
Expand Down

0 comments on commit 9c19d1e

Please sign in to comment.