ResidenceArea.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use Doctrine\Common\Collections\ArrayCollection;
  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. * Zone de résidence d'un Access, telle que définie par l'Organization
  12. *
  13. * @Iri("http://schema.org/ResidenceArea")
  14. */
  15. #[ORM\Entity]
  16. class ResidenceArea
  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(['residencearea', 'accesses_list_accessbilling'])]
  27. private $id;
  28. /**
  29. * @var BillingSetting
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'BillingSetting', inversedBy: 'residenceAreas')]
  32. #[ORM\JoinColumn(nullable: false)]
  33. #[Assert\NotNull]
  34. #[Groups(['residencearea'])]
  35. private $billingSetting;
  36. /**
  37. * @var string
  38. */
  39. #[ORM\Column(type: 'string')]
  40. #[Assert\Type(type: 'string')]
  41. #[Assert\NotNull]
  42. #[Groups(['residencearea', 'residencearea_reference', 'access_details_accessbilling', 'accesses_list_accessbilling', 'student_list_accessbilling', 'guardians_list_accessbilling', 'adherent_list_accessbilling', 'payer_list_accessbilling', 'fusion_accesses_accessbilling'])]
  43. private $label;
  44. /**
  45. * @var ArrayCollection<AccessBilling>
  46. */
  47. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessBilling', mappedBy: 'residenceArea')]
  48. #[Groups(['residencearea_accessbilling'])]
  49. private $accessBilling;
  50. /**
  51. * @var ArrayCollection<IntangibleDiscountDetail>
  52. */
  53. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\IntangibleDiscountDetail', mappedBy: 'residenceArea')]
  54. #[Groups(['residencearea_intangiblediscountdetail'])]
  55. private $intangibleDiscountDetails;
  56. /**
  57. * Constructor
  58. */
  59. public function __construct()
  60. {
  61. $this->accessBilling = new ArrayCollection();
  62. $this->intangibleDiscountDetails = new ArrayCollection();
  63. }
  64. /**
  65. * Sets id.
  66. *
  67. * @param int $id
  68. *
  69. * @return $this
  70. */
  71. public function setId($id)
  72. {
  73. $this->id = $id;
  74. return $this;
  75. }
  76. /**
  77. * Gets id.
  78. *
  79. * @return int
  80. */
  81. public function getId()
  82. {
  83. return $this->id;
  84. }
  85. /**
  86. * Set label
  87. *
  88. * @param string $label
  89. *
  90. * @return ResidenceArea
  91. */
  92. public function setLabel($label)
  93. {
  94. $this->label = $label;
  95. return $this;
  96. }
  97. /**
  98. * Get label
  99. *
  100. * @return string
  101. */
  102. public function getLabel()
  103. {
  104. return $this->label;
  105. }
  106. /**
  107. * Set billingSetting
  108. *
  109. * @param \AppBundle\Entity\Billing\BillingSetting $billingSetting
  110. *
  111. * @return ResidenceArea
  112. */
  113. public function setBillingSetting(\AppBundle\Entity\Billing\BillingSetting $billingSetting)
  114. {
  115. $this->billingSetting = $billingSetting;
  116. return $this;
  117. }
  118. /**
  119. * Get billingSetting
  120. *
  121. * @return \AppBundle\Entity\Billing\BillingSetting
  122. */
  123. public function getBillingSetting()
  124. {
  125. return $this->billingSetting;
  126. }
  127. /**
  128. * Add accessBilling
  129. *
  130. * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
  131. *
  132. * @return ResidenceArea
  133. */
  134. public function addAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling)
  135. {
  136. $this->accessBilling[] = $accessBilling;
  137. return $this;
  138. }
  139. /**
  140. * Remove accessBilling
  141. *
  142. * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
  143. */
  144. public function removeAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling)
  145. {
  146. $this->accessBilling->removeElement($accessBilling);
  147. }
  148. /**
  149. * Get accessBilling
  150. *
  151. * @return \Doctrine\Common\Collections\Collection
  152. */
  153. public function getAccessBilling()
  154. {
  155. return $this->accessBilling;
  156. }
  157. /**
  158. * Add intangibleDiscountDetail
  159. *
  160. * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail
  161. *
  162. * @return ResidenceArea
  163. */
  164. public function addIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail)
  165. {
  166. $this->intangibleDiscountDetails[] = $intangibleDiscountDetail;
  167. return $this;
  168. }
  169. /**
  170. * Remove intangibleDiscountDetail
  171. *
  172. * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail
  173. */
  174. public function removeIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail)
  175. {
  176. $this->intangibleDiscountDetails->removeElement($intangibleDiscountDetail);
  177. }
  178. /**
  179. * Get intangibleDiscountDetails
  180. *
  181. * @return \Doctrine\Common\Collections\Collection
  182. */
  183. public function getIntangibleDiscountDetails()
  184. {
  185. return $this->intangibleDiscountDetails;
  186. }
  187. }