Qualification.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. namespace AppBundle\Entity\Person;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Dunglas\ApiBundle\Annotation\Iri;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use AppBundle\Entity\Traits\TimestampableEntity;
  8. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  9. /**
  10. * Diplôme associé à une Person
  11. *
  12. * @Iri("http://schema.org/Qualification")
  13. */
  14. #[ORM\Entity]
  15. class Qualification
  16. {
  17. use TimestampableEntity;
  18. use CreatorUpdaterEntity;
  19. /**
  20. * @var int
  21. */
  22. #[ORM\Column(type: 'integer')]
  23. #[ORM\Id]
  24. #[ORM\GeneratedValue(strategy: 'AUTO')]
  25. #[Groups(['qualification', 'access_informations_edit_person'])]
  26. private $id;
  27. /**
  28. * @var Person
  29. */
  30. #[ORM\ManyToOne(targetEntity: 'Person', inversedBy: 'qualifications')]
  31. #[ORM\JoinColumn(nullable: false)]
  32. #[Assert\NotNull]
  33. #[Groups(['qualification'])]
  34. private $person;
  35. /**
  36. * @var string
  37. */
  38. #[ORM\Column(type: 'string', length: 60, nullable: true)]
  39. #[Assert\Type(type: 'string')]
  40. #[Groups(['qualification', 'access_informations_edit_person'])]
  41. private $diploma;
  42. /**
  43. * @var \DateTime
  44. */
  45. #[ORM\Column(type: 'date', nullable: true)]
  46. #[Assert\Date]
  47. #[Groups(['qualification', 'access_informations_edit_person'])]
  48. private $date;
  49. /**
  50. * @var string
  51. */
  52. #[ORM\Column(type: 'string', length: 30, nullable: true)]
  53. #[Assert\Type(type: 'string')]
  54. #[Groups(['qualification', 'access_informations_edit_person'])]
  55. private $mention;
  56. /**
  57. * @var string
  58. */
  59. #[ORM\Column(type: 'string', length: 30, nullable: true)]
  60. #[Assert\Type(type: 'string')]
  61. #[Groups(['qualification', 'access_informations_edit_person'])]
  62. private $establishment;
  63. /**
  64. * @var string
  65. */
  66. #[ORM\Column(type: 'string', length: 35, nullable: true)]
  67. #[Assert\Type(type: 'string')]
  68. #[Groups(['qualification', 'access_informations_edit_person'])]
  69. private $city;
  70. /**
  71. * Sets id.
  72. *
  73. * @param int $id
  74. *
  75. * @return $this
  76. */
  77. public function setId($id)
  78. {
  79. $this->id = $id;
  80. return $this;
  81. }
  82. /**
  83. * Gets id.
  84. *
  85. * @return int
  86. */
  87. public function getId()
  88. {
  89. return $this->id;
  90. }
  91. /**
  92. * Sets person.
  93. *
  94. * @param Person $person
  95. *
  96. * @return $this
  97. */
  98. public function setPerson(Person $person)
  99. {
  100. $this->person = $person;
  101. return $this;
  102. }
  103. /**
  104. * Gets person.
  105. *
  106. * @return Person
  107. */
  108. public function getPerson()
  109. {
  110. return $this->person;
  111. }
  112. /**
  113. * Sets date.
  114. *
  115. * @param \DateTime $date
  116. *
  117. * @return $this
  118. */
  119. public function setDate(\DateTime $date = null)
  120. {
  121. $this->date = $date;
  122. return $this;
  123. }
  124. /**
  125. * Gets date.
  126. *
  127. * @return \DateTime
  128. */
  129. public function getDate()
  130. {
  131. return $this->date;
  132. }
  133. /**
  134. * Sets mention.
  135. *
  136. * @param string $mention
  137. *
  138. * @return $this
  139. */
  140. public function setMention($mention)
  141. {
  142. $this->mention = $mention;
  143. return $this;
  144. }
  145. /**
  146. * Gets mention.
  147. *
  148. * @return string
  149. */
  150. public function getMention()
  151. {
  152. return $this->mention;
  153. }
  154. /**
  155. * Sets establishment.
  156. *
  157. * @param string $establishment
  158. *
  159. * @return $this
  160. */
  161. public function setEstablishment($establishment)
  162. {
  163. $this->establishment = $establishment;
  164. return $this;
  165. }
  166. /**
  167. * Gets establishment.
  168. *
  169. * @return string
  170. */
  171. public function getEstablishment()
  172. {
  173. return $this->establishment;
  174. }
  175. /**
  176. * Sets city.
  177. *
  178. * @param string $city
  179. *
  180. * @return $this
  181. */
  182. public function setCity($city)
  183. {
  184. $this->city = $city;
  185. return $this;
  186. }
  187. /**
  188. * Gets city.
  189. *
  190. * @return string
  191. */
  192. public function getCity()
  193. {
  194. return $this->city;
  195. }
  196. /**
  197. * Set diploma
  198. *
  199. * @param string $diploma
  200. *
  201. * @return Qualification
  202. */
  203. public function setDiploma($diploma)
  204. {
  205. $this->diploma = $diploma;
  206. return $this;
  207. }
  208. /**
  209. * Get diploma
  210. *
  211. * @return string
  212. */
  213. public function getDiploma()
  214. {
  215. return $this->diploma;
  216. }
  217. }