OrganizationLicence.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?php
  2. namespace AppBundle\Entity\Organization;
  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 Symfony\Component\Validator\Constraints as Assert;
  8. use AppBundle\Entity\Traits\TimestampableEntity;
  9. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  10. /**
  11. * Licence possédée par une Organization
  12. *
  13. * @Iri("http://schema.org/OrganizationLicence")
  14. */
  15. #[ORM\Entity]
  16. class OrganizationLicence
  17. {
  18. use TimestampableEntity;
  19. use CreatorUpdaterEntity;
  20. /**
  21. * @var int
  22. */
  23. #[ORM\Column(type: 'integer')]
  24. #[ORM\Id]
  25. #[ORM\GeneratedValue(strategy: 'AUTO')]
  26. #[Groups(['organizationlicence', 'organization_details'])]
  27. private $id;
  28. /**
  29. * @var Organization
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'Organization', inversedBy: 'organizationLicences')]
  32. #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', nullable: false)]
  33. #[Assert\NotNull]
  34. #[Groups(['organizationlicence'])]
  35. private $organization;
  36. /**
  37. * @var Access
  38. */
  39. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'organizationLicences')]
  40. #[ORM\JoinColumn(nullable: false)]
  41. #[Assert\NotNull]
  42. #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
  43. private $licensee;
  44. /**
  45. * @var string
  46. */
  47. #[ORM\Column(type: 'string', nullable: true)]
  48. #[Assert\Type(type: 'string')]
  49. #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
  50. private $licenceNumber;
  51. /**
  52. * @var string
  53. */
  54. #[ORM\Column(type: 'string', nullable: true)]
  55. #[Assert\Type(type: 'string')]
  56. #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
  57. private $categorie;
  58. /**
  59. * @var \DateTime
  60. */
  61. #[ORM\Column(type: 'date', nullable: true)]
  62. #[Assert\Date]
  63. #[Groups(['organizationlicence', 'organization_details_organizationlicences'])]
  64. private $validityDate;
  65. /**
  66. * Sets id.
  67. *
  68. * @param int $id
  69. *
  70. * @return $this
  71. */
  72. public function setId($id)
  73. {
  74. $this->id = $id;
  75. return $this;
  76. }
  77. /**
  78. * Gets id.
  79. *
  80. * @return int
  81. */
  82. public function getId()
  83. {
  84. return $this->id;
  85. }
  86. /**
  87. * Sets Organization.
  88. *
  89. * @param Organization $organization
  90. *
  91. * @return $this
  92. */
  93. public function setOrganization(Organization $organization = null)
  94. {
  95. $this->organization = $organization;
  96. return $this;
  97. }
  98. /**
  99. * Gets organization.
  100. *
  101. * @return Organization
  102. */
  103. public function getOrganization()
  104. {
  105. return $this->organization;
  106. }
  107. /**
  108. * Sets Access.
  109. *
  110. * @param Access $licensee
  111. *
  112. * @return $this
  113. */
  114. public function setLicensee(Access $licensee = null)
  115. {
  116. $this->licensee = $licensee;
  117. return $this;
  118. }
  119. /**
  120. * Gets licensee.
  121. *
  122. * @return Access
  123. */
  124. public function getLicensee()
  125. {
  126. return $this->licensee;
  127. }
  128. /**
  129. * Sets licenceNumber.
  130. *
  131. * @param string $licenceNumber
  132. *
  133. * @return $this
  134. */
  135. public function setLicenceNumber($licenceNumber)
  136. {
  137. $this->licenceNumber = $licenceNumber;
  138. return $this;
  139. }
  140. /**
  141. * Gets licenceNumber.
  142. *
  143. * @return string
  144. */
  145. public function getLicenceNumber()
  146. {
  147. return $this->licenceNumber;
  148. }
  149. /**
  150. * Sets categorie.
  151. *
  152. * @param string $categorie
  153. *
  154. * @return $this
  155. */
  156. public function setCategorie($categorie)
  157. {
  158. $this->categorie = $categorie;
  159. return $this;
  160. }
  161. /**
  162. * Gets categorie.
  163. *
  164. * @return string
  165. */
  166. public function getCategorie()
  167. {
  168. return $this->categorie;
  169. }
  170. /**
  171. * Sets validityDate.
  172. *
  173. * @param \DateTime $validityDate
  174. *
  175. * @return $this
  176. */
  177. public function setValidityDate(\DateTime $validityDate = null)
  178. {
  179. $this->validityDate = $validityDate;
  180. return $this;
  181. }
  182. /**
  183. * Gets validityDate.
  184. *
  185. * @return \DateTime
  186. */
  187. public function getValidityDate()
  188. {
  189. return $this->validityDate;
  190. }
  191. }