UsersTagsFavorites.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. namespace Muzich\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Cette classe représente la relation porteuse entre User et Tag,
  6. * en tant que Tags favoris de l'utilisateur.
  7. *
  8. * @ORM\Entity
  9. * @ORM\Table(name="users_tags_favorites")
  10. */
  11. class UsersTagsFavorites
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\Column(type="integer")
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. * @var type int
  18. */
  19. protected $id;
  20. /**
  21. * Cet attribut contient l'objet User lié
  22. *
  23. * @ORM\ManyToOne(targetEntity="User", inversedBy="tags")
  24. * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  25. */
  26. protected $user;
  27. /**
  28. * Cet attribut contient l'objet Tag lié
  29. *
  30. * @ORM\ManyToOne(targetEntity="Tag", inversedBy="users")
  31. * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
  32. */
  33. protected $tag;
  34. /**
  35. * L'attribut position permet de connaitre l'ordre de préfèrence de
  36. * l'utilisateur.
  37. *
  38. * @ORM\Column(type="integer")
  39. * @var type int
  40. */
  41. protected $position;
  42. /**
  43. * Set position
  44. *
  45. * @param integer $position
  46. */
  47. public function setPosition($position)
  48. {
  49. $this->position = $position;
  50. }
  51. /**
  52. * Get position
  53. *
  54. * @return integer
  55. */
  56. public function getPosition()
  57. {
  58. return $this->position;
  59. }
  60. /**
  61. * Get id
  62. *
  63. * @return integer
  64. */
  65. public function getId()
  66. {
  67. return $this->id;
  68. }
  69. /**
  70. * Set user
  71. *
  72. * @param User $user
  73. */
  74. public function setUser(User $user)
  75. {
  76. $this->user = $user;
  77. }
  78. /**
  79. * Get user
  80. *
  81. * @return User
  82. */
  83. public function getUser()
  84. {
  85. return $this->user;
  86. }
  87. /**
  88. * Set tag
  89. *
  90. * @param Tag $tag
  91. */
  92. public function setTag(Tag $tag)
  93. {
  94. $this->tag = $tag;
  95. }
  96. /**
  97. * Get tag
  98. *
  99. * @return Tag
  100. */
  101. public function getTag()
  102. {
  103. return $this->tag;
  104. }
  105. }