CalendarSynchro.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. namespace AppBundle\Entity\Booking;
  3. use AppBundle\Annotation\DefaultField;
  4. use AppBundle\Entity\AccessAndFunction\Access;
  5. use AppBundle\Entity\Traits\ActivityYearTrait;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use AppBundle\Entity\Traits\TimestampableEntity;
  11. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  12. #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Booking\Repository\CalendarSynchroRepository')]
  13. class CalendarSynchro
  14. {
  15. use TimestampableEntity;
  16. use CreatorUpdaterEntity;
  17. /**
  18. * @var int
  19. */
  20. #[ORM\Column(type: 'integer')]
  21. #[ORM\Id]
  22. #[ORM\GeneratedValue(strategy: 'AUTO')]
  23. #[Groups(['calendarsynchro'])]
  24. private $id;
  25. /**
  26. * @var Access
  27. */
  28. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'calendarSynchro', cascade: ['persist'], fetch: 'EAGER')]
  29. #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
  30. #[Groups(['calendarsynchro'])]
  31. private $access;
  32. /**
  33. * @var string
  34. */
  35. #[ORM\Column(type: 'string', nullable: false)]
  36. #[Groups(['calendarsynchro'])]
  37. protected $hash;
  38. /**
  39. * @var \DateTime
  40. */
  41. #[ORM\Column(type: 'datetime', nullable: true)]
  42. #[Assert\DateTime]
  43. #[Groups(['calendarsynchro'])]
  44. private $datetimeStart;
  45. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Core\File', inversedBy: 'calendarSynchro', cascade: ['persist'], fetch: 'EAGER')]
  46. #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
  47. #[Groups(['calendarsynchro'])]
  48. private $file;
  49. /**
  50. * @var array
  51. *
  52. *
  53. */
  54. #[ORM\Column(type: 'json_array', nullable: true)]
  55. protected $types;
  56. /**
  57. * @var bool
  58. */
  59. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  60. #[Assert\Type(type: 'boolean')]
  61. #[Assert\NotNull]
  62. #[Groups(['calendarsynchro'])]
  63. private $eventsHaveChanged = false;
  64. public function __construct()
  65. {
  66. }
  67. /**
  68. * Sets id.
  69. *
  70. * @param int $id
  71. *
  72. * @return $this
  73. */
  74. public function setId($id)
  75. {
  76. $this->id = $id;
  77. return $this;
  78. }
  79. /**
  80. * Get id
  81. *
  82. * @return integer
  83. */
  84. public function getId()
  85. {
  86. return $this->id;
  87. }
  88. /**
  89. * Set datetimeStart
  90. *
  91. * @param \DateTime $datetimeStart
  92. *
  93. * @return CalendarSynchro
  94. */
  95. public function setDatetimeStart($datetimeStart)
  96. {
  97. $this->datetimeStart = $datetimeStart;
  98. return $this;
  99. }
  100. /**
  101. * Get datetimeStart
  102. *
  103. * @return \DateTime
  104. */
  105. public function getDatetimeStart()
  106. {
  107. return $this->datetimeStart;
  108. }
  109. /**
  110. * Set access
  111. *
  112. * @param \AppBundle\Entity\AccessAndFunction\Access $access
  113. *
  114. * @return CalendarSynchro
  115. */
  116. public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access = null)
  117. {
  118. $this->access = $access;
  119. return $this;
  120. }
  121. /**
  122. * Get access
  123. *
  124. * @return \AppBundle\Entity\AccessAndFunction\Access
  125. */
  126. public function getAccess()
  127. {
  128. return $this->access;
  129. }
  130. /**
  131. * Set hash
  132. *
  133. * @param string $hash
  134. *
  135. * @return CalendarSynchro
  136. */
  137. public function setHash($hash)
  138. {
  139. $this->hash = $hash;
  140. return $this;
  141. }
  142. /**
  143. * Get hash
  144. *
  145. * @return string
  146. */
  147. public function getHash()
  148. {
  149. return $this->hash;
  150. }
  151. /**
  152. * Set file
  153. *
  154. * @param \AppBundle\Entity\Core\File $file
  155. *
  156. * @return CalendarSynchro
  157. */
  158. public function setFile(\AppBundle\Entity\Core\File $file = null)
  159. {
  160. $this->file = $file;
  161. return $this;
  162. }
  163. /**
  164. * Get file
  165. *
  166. * @return \AppBundle\Entity\Core\File
  167. */
  168. public function getFile()
  169. {
  170. return $this->file;
  171. }
  172. /**
  173. * Set eventsHaveChanged
  174. *
  175. * @param boolean $eventsHaveChanged
  176. *
  177. * @return CalendarSynchro
  178. */
  179. public function setEventsHaveChanged($eventsHaveChanged)
  180. {
  181. $this->eventsHaveChanged = $eventsHaveChanged;
  182. return $this;
  183. }
  184. /**
  185. * Get eventsHaveChanged
  186. *
  187. * @return boolean
  188. */
  189. public function getEventsHaveChanged()
  190. {
  191. return $this->eventsHaveChanged;
  192. }
  193. /**
  194. * Set types
  195. *
  196. * @param array $types
  197. *
  198. * @return CalendarSynchro
  199. */
  200. public function setTypes($types)
  201. {
  202. $this->types = $types;
  203. return $this;
  204. }
  205. /**
  206. * Get types
  207. *
  208. * @return array
  209. */
  210. public function getTypes()
  211. {
  212. return $this->types;
  213. }
  214. }