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
This commit is contained in:
parent
626efdafd4
commit
9c19d1e5c4
@ -42,6 +42,7 @@ information about its type and if it's the owning or inverse side.
|
|||||||
* Bidirectional - Many users have Many favorite comments (OWNING 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;
|
private $favorites;
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ information about its type and if it's the owning or inverse side.
|
|||||||
* Unidirectional - Many users have marked many comments as read
|
* Unidirectional - Many users have marked many comments as read
|
||||||
*
|
*
|
||||||
* @ManyToMany(targetEntity="Comment")
|
* @ManyToMany(targetEntity="Comment")
|
||||||
|
* @JoinTable(name="user_read_comments")
|
||||||
*/
|
*/
|
||||||
private $commentsRead;
|
private $commentsRead;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user