DocumentWish.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <?php
  2. namespace AppBundle\Entity\AccessWish;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Finite\StatefulInterface;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use AppBundle\Entity\Traits\TimestampableEntity;
  10. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  11. /**
  12. * DocumentWish.
  13. *
  14. * @see http://schema.org/DocumentWish Documentation on Schema.org
  15. *
  16. * @Iri("http://schema.org/DocumentWish")
  17. */
  18. #[ORM\Entity]
  19. class DocumentWish
  20. {
  21. use TimestampableEntity;
  22. use CreatorUpdaterEntity;
  23. /**
  24. * @var int
  25. */
  26. #[ORM\Column(type: 'integer')]
  27. #[ORM\Id]
  28. #[ORM\GeneratedValue(strategy: 'AUTO')]
  29. #[Groups(['documentwish', 'online_registration', 'online_registration_validation', 'student_registration_person'])]
  30. private $id;
  31. /**
  32. * @var AccessWish
  33. *
  34. *
  35. */
  36. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessWish\AccessWish', inversedBy: 'documentWishes')]
  37. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  38. #[Groups(['documentwish'])]
  39. private $accessWish;
  40. /**
  41. * @var AccessWish
  42. *
  43. *
  44. */
  45. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Person\Person', inversedBy: 'documentWishes')]
  46. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  47. #[Groups(['documentwish'])]
  48. private $personOwner;
  49. /**
  50. * @var ArrayCollection<AppBundle\Entity\Core\File>.
  51. */
  52. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\File', mappedBy: 'documentWish', orphanRemoval: true)]
  53. #[Groups(['documentwish', 'online_registration_documentwishes', 'online_registration_validation_documentwishes', 'access_files_person', 'student_registration_person'])]
  54. private $files;
  55. /**
  56. * @var string
  57. */
  58. #[ORM\Column(type: 'string', nullable: true)]
  59. #[Assert\Type(type: 'string')]
  60. #[Groups(['documentwish', 'online_registration_documentwishes', 'online_registration_validation_documentwishes', 'access_files_person', 'student_registration_person'])]
  61. private $label;
  62. /**
  63. * @var string
  64. */
  65. #[ORM\Column(type: 'string', nullable: true)]
  66. #[Assert\Type(type: 'string')]
  67. #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\FileTypeEnum', 'toArray'], message: 'invalid-choice')]
  68. #[Groups(['documentwish', 'online_registration_documentwishes', 'online_registration_validation_documentwishes', 'access_files_person', 'student_registration_person'])]
  69. private $type;
  70. /**
  71. * @var string
  72. */
  73. #[ORM\Column(type: 'text', nullable: true)]
  74. #[Assert\Type(type: 'string')]
  75. #[Groups(['documentwish', 'online_registration_documentwishes', 'online_registration_validation_documentwishes', 'access_files_person', 'student_registration_person'])]
  76. private $description;
  77. /**
  78. * Constructor
  79. */
  80. public function __construct()
  81. {
  82. $this->files = new ArrayCollection();
  83. }
  84. /**
  85. * Get id
  86. *
  87. * @return integer
  88. */
  89. public function getId()
  90. {
  91. return $this->id;
  92. }
  93. /**
  94. * Set days
  95. *
  96. * @param array $days
  97. *
  98. * @return EducationStudentWish
  99. */
  100. public function setDays($days)
  101. {
  102. $this->days = $days;
  103. return $this;
  104. }
  105. /**
  106. * Get days
  107. *
  108. * @return array
  109. */
  110. public function getDays()
  111. {
  112. return $this->days;
  113. }
  114. /**
  115. * Set education
  116. *
  117. * @param \AppBundle\Entity\Education\Education $education
  118. *
  119. * @return EducationStudentWish
  120. */
  121. public function setEducation(\AppBundle\Entity\Education\Education $education = null)
  122. {
  123. $this->education = $education;
  124. return $this;
  125. }
  126. /**
  127. * Get education
  128. *
  129. * @return \AppBundle\Entity\Education\Education
  130. */
  131. public function getEducation()
  132. {
  133. return $this->education;
  134. }
  135. /**
  136. * Set accessWish
  137. *
  138. * @param \AppBundle\Entity\AccessWish\AccessWish $accessWish
  139. *
  140. * @return EducationStudentWish
  141. */
  142. public function setAccessWish(\AppBundle\Entity\AccessWish\AccessWish $accessWish = null)
  143. {
  144. $this->accessWish = $accessWish;
  145. return $this;
  146. }
  147. /**
  148. * Get accessWish
  149. *
  150. * @return \AppBundle\Entity\AccessWish\AccessWish
  151. */
  152. public function getAccessWish()
  153. {
  154. return $this->accessWish;
  155. }
  156. /**
  157. * Set label
  158. *
  159. * @param string $label
  160. *
  161. * @return DocumentWish
  162. */
  163. public function setLabel($label)
  164. {
  165. $this->label = $label;
  166. return $this;
  167. }
  168. /**
  169. * Get label
  170. *
  171. * @return string
  172. */
  173. public function getLabel()
  174. {
  175. return $this->label;
  176. }
  177. /**
  178. * Set type
  179. *
  180. * @param string $type
  181. *
  182. * @return DocumentWish
  183. */
  184. public function setType($type)
  185. {
  186. $this->type = $type;
  187. return $this;
  188. }
  189. /**
  190. * Get type
  191. *
  192. * @return string
  193. */
  194. public function getType()
  195. {
  196. return $this->type;
  197. }
  198. /**
  199. * Set description
  200. *
  201. * @param string $description
  202. *
  203. * @return DocumentWish
  204. */
  205. public function setDescription($description)
  206. {
  207. $this->description = $description;
  208. return $this;
  209. }
  210. /**
  211. * Get description
  212. *
  213. * @return string
  214. */
  215. public function getDescription()
  216. {
  217. return $this->description;
  218. }
  219. /**
  220. * Add file
  221. *
  222. * @param \AppBundle\Entity\Core\File $file
  223. *
  224. * @return DocumentWish
  225. */
  226. public function addFile(\AppBundle\Entity\Core\File $file)
  227. {
  228. $file->setDocumentWish($this);
  229. $this->files[] = $file;
  230. return $this;
  231. }
  232. /**
  233. * Remove file
  234. *
  235. * @param \AppBundle\Entity\Core\File $file
  236. */
  237. public function removeFile(\AppBundle\Entity\Core\File $file)
  238. {
  239. $this->files->removeElement($file);
  240. }
  241. /**
  242. * Get files
  243. *
  244. * @return \Doctrine\Common\Collections\Collection
  245. */
  246. public function getFiles()
  247. {
  248. return $this->files;
  249. }
  250. /**
  251. * Set personOwner
  252. *
  253. * @param \AppBundle\Entity\Person\Person $personOwner
  254. *
  255. * @return DocumentWish
  256. */
  257. public function setPersonOwner(\AppBundle\Entity\Person\Person $personOwner = null)
  258. {
  259. $this->personOwner = $personOwner;
  260. return $this;
  261. }
  262. /**
  263. * Get personOwner
  264. *
  265. * @return \AppBundle\Entity\Person\Person
  266. */
  267. public function getPersonOwner()
  268. {
  269. return $this->personOwner;
  270. }
  271. }