Commentaire.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Commentaire
  6. *
  7. * @ORM\Table(name="commentaire")
  8. * @ORM\Entity(repositoryClass="App\Repository\CommentaireRepository")
  9. */
  10. class Commentaire
  11. {
  12. /**
  13. * @var int
  14. *
  15. * @ORM\Column(name="id", type="integer")
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @var string
  22. *
  23. * @ORM\Column(name="contenu", type="text", length=191, nullable=true)
  24. */
  25. private $contenu;
  26. /**
  27. * @var int
  28. *
  29. * @ORM\Column(name="note", type="integer", nullable=true)
  30. *
  31. */
  32. private $note;
  33. /**
  34. * @ORM\ManyToOne(targetEntity="App\Entity\Film", inversedBy="commentaires")
  35. * @ORM\JoinColumn(nullable=false)
  36. */
  37. private $film;
  38. /**
  39. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  40. * @ORM\JoinColumn(nullable=false)
  41. */
  42. private $user;
  43. /**
  44. * @ORM\Column(type="datetime", nullable=true)
  45. */
  46. private $dateSubmitted;
  47. /**
  48. * Constructor
  49. */
  50. public function __construct ()
  51. {
  52. $this->dateSubmitted = new \DateTime('now');
  53. }
  54. /**
  55. * Get id
  56. *
  57. * @return int
  58. */
  59. public function getId()
  60. {
  61. return $this->id;
  62. }
  63. /**
  64. * Set contenu
  65. *
  66. * @param string $contenu
  67. *
  68. * @return Commentaire
  69. */
  70. public function setContenu($contenu)
  71. {
  72. $this->contenu = $contenu;
  73. return $this;
  74. }
  75. /**
  76. * Get contenu
  77. *
  78. * @return string
  79. */
  80. public function getContenu()
  81. {
  82. return $this->contenu;
  83. }
  84. /**
  85. * @return int
  86. */
  87. public function getNote()
  88. {
  89. return $this->note;
  90. }
  91. /**
  92. * @param int $note
  93. */
  94. public function setNote($note)
  95. {
  96. $this->note = $note;
  97. }
  98. /**
  99. * Set film
  100. *
  101. * @param \App\Entity\Film $film
  102. *
  103. * @return Commentaire
  104. */
  105. public function setFilm(\App\Entity\Film $film)
  106. {
  107. $this->film = $film;
  108. return $this;
  109. }
  110. /**
  111. * Get film
  112. *
  113. * @return \App\Entity\Film
  114. */
  115. public function getFilm()
  116. {
  117. return $this->film;
  118. }
  119. /**
  120. * Set user
  121. *
  122. * @param \App\Entity\User $user
  123. *
  124. * @return Commentaire
  125. */
  126. public function setUser(\App\Entity\User $user)
  127. {
  128. $this->user = $user;
  129. return $this;
  130. }
  131. /**
  132. * Get user
  133. *
  134. * @return \App\Entity\User
  135. */
  136. public function getUser()
  137. {
  138. return $this->user;
  139. }
  140. public function getDateSubmitted(): ?\DateTimeInterface
  141. {
  142. return $this->dateSubmitted;
  143. }
  144. public function setDateSubmitted(?\DateTimeInterface $dateSubmitted): self
  145. {
  146. $this->dateSubmitted = $dateSubmitted;
  147. return $this;
  148. }
  149. }