EventUser.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <?php
  2. namespace AppBundle\Entity\Booking;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use AppBundle\Entity\Traits\TimestampableEntity;
  8. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11. *
  12. * Participation d'un Access à un Event
  13. *
  14. * @Iri("http://schema.org/EventUser")
  15. */
  16. #[ORM\Entity]
  17. #[ORM\Table]
  18. #[ORM\Index(name: 'participation', columns: ['participation'])]
  19. #[ORM\Index(name: 'datetimeStart', columns: ['datetimeStart'])]
  20. class EventUser
  21. {
  22. use TimestampableEntity;
  23. use CreatorUpdaterEntity;
  24. /**
  25. * @var int
  26. */
  27. #[ORM\Column(type: 'integer')]
  28. #[ORM\Id]
  29. #[ORM\GeneratedValue(strategy: 'AUTO')]
  30. #[Groups(['eventuser', 'presence_attendance', 'event_details'])]
  31. private $id;
  32. /**
  33. * @var Event
  34. */
  35. #[ORM\ManyToOne(targetEntity: 'Event', inversedBy: 'eventUser')]
  36. #[Groups(['eventuser', 'invitations_list'])]
  37. private $event;
  38. /**
  39. * @var Access
  40. */
  41. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'eventUsers')]
  42. #[Groups(['eventuser', 'presence_attendance_eventuser', 'event_details_eventuserfiltered', 'invitations_list', 'event_details_eventuser'])]
  43. private $guest;
  44. /**
  45. * @var string
  46. */
  47. #[ORM\Column(type: 'string', nullable: true)]
  48. #[Assert\Type(type: 'string')]
  49. #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\ParticipationStatusEnum', 'toArray'])]
  50. #[Groups(['eventuser', 'invitations_list', 'event_details_eventuser'])]
  51. private $participation;
  52. /**
  53. * @var string
  54. */
  55. #[ORM\Column(type: 'string', options: ['default' => 'READY'])]
  56. #[Assert\Type(type: 'string')]
  57. #[Assert\NotNull]
  58. #[Assert\Choice(callback: ['\AppBundle\Enum\Message\MessageStatusEnum', 'toArray'])]
  59. #[Groups(['eventuser'])]
  60. private $statusMail = "READY";
  61. /**
  62. * @var \DateTime
  63. */
  64. #[ORM\Column(type: 'datetime')]
  65. #[Assert\DateTime]
  66. #[Assert\NotNull]
  67. #[Groups(['eventuser', 'invitations_list', 'presence_attendance_eventuser', 'event_details_eventuser'])]
  68. private $datetimeStart;
  69. /**
  70. * @var \DateTime
  71. */
  72. #[ORM\Column(type: 'datetime', nullable: true)]
  73. #[Assert\DateTime]
  74. #[Groups(['eventuser', 'invitations_list'])]
  75. private $datetimeEnd;
  76. /**
  77. * @var bool
  78. */
  79. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  80. #[Assert\Type(type: 'boolean')]
  81. #[Assert\NotNull]
  82. #[Groups(['eventuser'])]
  83. private $attendance = false;
  84. /**
  85. * Sets id.
  86. *
  87. * @param int $id
  88. *
  89. * @return $this
  90. */
  91. public function setId($id)
  92. {
  93. $this->id = $id;
  94. return $this;
  95. }
  96. /**
  97. * Gets id.
  98. *
  99. * @return int
  100. */
  101. public function getId()
  102. {
  103. return $this->id;
  104. }
  105. /**
  106. * Sets event.
  107. *
  108. * @param Event $event
  109. *
  110. * @return $this
  111. */
  112. public function setEvent(Event $event = null)
  113. {
  114. $this->event = $event;
  115. return $this;
  116. }
  117. /**
  118. * Gets event.
  119. *
  120. * @return Event
  121. */
  122. public function getEvent()
  123. {
  124. return $this->event;
  125. }
  126. /**
  127. * Sets guest.
  128. *
  129. * @param Access $guest
  130. *
  131. * @return $this
  132. */
  133. public function setGuest(Access $guest = null)
  134. {
  135. $this->guest = $guest;
  136. return $this;
  137. }
  138. /**
  139. * Gets guest.
  140. *
  141. * @return Access
  142. */
  143. public function getGuest()
  144. {
  145. return $this->guest;
  146. }
  147. /**
  148. * Sets participation.
  149. *
  150. * @param string $participation
  151. *
  152. * @return $this
  153. */
  154. public function setParticipation($participation)
  155. {
  156. $this->participation = $participation;
  157. return $this;
  158. }
  159. /**
  160. * Gets participation.
  161. *
  162. * @return string
  163. */
  164. public function getParticipation()
  165. {
  166. return $this->participation;
  167. }
  168. /**
  169. * Sets datetimeStart.
  170. *
  171. * @param \DateTime $datetimeStart
  172. *
  173. * @return $this
  174. */
  175. public function setDatetimeStart(\DateTime $datetimeStart)
  176. {
  177. $this->datetimeStart = $datetimeStart;
  178. return $this;
  179. }
  180. /**
  181. * Gets datetimeStart.
  182. *
  183. * @return \DateTime
  184. */
  185. public function getDatetimeStart()
  186. {
  187. return $this->datetimeStart;
  188. }
  189. /**
  190. * Sets datetimeEnd.
  191. *
  192. * @param \DateTime $datetimeEnd
  193. *
  194. * @return $this
  195. */
  196. public function setDatetimeEnd(\DateTime $datetimeEnd)
  197. {
  198. $this->datetimeEnd = $datetimeEnd;
  199. return $this;
  200. }
  201. /**
  202. * Gets datetimeEnd.
  203. *
  204. * @return \DateTime
  205. */
  206. public function getDatetimeEnd()
  207. {
  208. return $this->datetimeEnd;
  209. }
  210. /**
  211. * Sets attendance.
  212. *
  213. * @param bool $attendance
  214. *
  215. * @return $this
  216. */
  217. public function setAttendance($attendance)
  218. {
  219. $this->attendance = $attendance;
  220. return $this;
  221. }
  222. /**
  223. * Gets attendance.
  224. *
  225. * @return bool
  226. */
  227. public function getAttendance()
  228. {
  229. return $this->attendance;
  230. }
  231. /**
  232. * Sets statusMail.
  233. *
  234. * @param string $statusMail
  235. *
  236. * @return $this
  237. */
  238. public function setStatusMail($statusMail)
  239. {
  240. $this->statusMail = $statusMail;
  241. return $this;
  242. }
  243. /**
  244. * Gets statusMail.
  245. *
  246. * @return string
  247. */
  248. public function getStatusMail()
  249. {
  250. return $this->statusMail;
  251. }
  252. }