Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Entity;
- /**
- * User
- *
- * @Table(name="user")
- * @Entity
- */
- class User
- {
- /**
- * Bidirectional - Many users have Many favorite comments (OWNING SIDE)
- *
- * @ManyToMany(targetEntity="Entity\Comment", inversedBy="userFavorites")
- * @JoinTable(name="user_favorite_comments",
- * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
- * inverseJoinColumns={@JoinColumn(name="favorite_comment_id", referencedColumnName="id")}
- * )
- */
- private $favorites;
- class Comment
- {
- /**
- * Bidirectional - Many comments are favorited by many users (INVERSE SIDE)
- *
- * @ManyToMany(targetEntity="Entity\User", mappedBy="favorites")
- */
- private $userFavorites;
Advertisement
Add Comment
Please, Sign In to add comment