IntangibleDiscountDetail.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. namespace AppBundle\Entity\Product;
  3. use AppBundle\Entity\Billing\FamilyQuotient;
  4. use AppBundle\Filter\Billing\ResidenceArea;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Dunglas\ApiBundle\Annotation\Iri;
  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. * Réduction appliquée à un élément de facturation Intangible,
  13. * résultant du quotient familial et/ou de la zone de résidence
  14. *
  15. * @Iri("http://schema.org/IntangibleDiscountDetail")
  16. */
  17. #[ORM\Entity]
  18. class IntangibleDiscountDetail
  19. {
  20. use TimestampableEntity;
  21. use CreatorUpdaterEntity;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['intangiblediscountdetail'])]
  29. private $id;
  30. /**
  31. * @var IntangiblePriceAndDiscount
  32. */
  33. #[ORM\ManyToOne(targetEntity: 'IntangiblePriceAndDiscount', inversedBy: 'intangibleDiscountDetails')]
  34. #[ORM\JoinColumn(nullable: false)]
  35. #[Assert\NotNull]
  36. #[Groups(['intangiblediscountdetail'])]
  37. private $intangiblePriceAndDiscount;
  38. /**
  39. * @var ResidenceArea
  40. */
  41. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\ResidenceArea', inversedBy: 'intangibleDiscountDetails')]
  42. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  43. #[Groups(['intangiblediscountdetail'])]
  44. private $residenceArea;
  45. /**
  46. * @var string
  47. */
  48. #[ORM\Column(type: 'string', nullable: true)]
  49. #[Assert\Type(type: 'string')]
  50. #[Assert\Choice(callback: ['AppBundle\Enum\Billing\PricingLineInvoiceLineEnum', 'toArray'])]
  51. #[Groups(['intangiblepriceanddiscount'])]
  52. private $pricingLine;
  53. /**
  54. * @var FamilyQuotient
  55. */
  56. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\FamilyQuotient', inversedBy: 'intangibleDiscountDetails')]
  57. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  58. #[Groups(['intangiblediscountdetail'])]
  59. private $familyQuotient;
  60. /**
  61. * @var float
  62. */
  63. #[ORM\Column(type: 'float', nullable: true)]
  64. #[Assert\Type(type: 'float')]
  65. #[Groups(['intangiblediscountdetail'])]
  66. private $price;
  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. * Gets id.
  81. *
  82. * @return int
  83. */
  84. public function getId()
  85. {
  86. return $this->id;
  87. }
  88. /**
  89. * Set pricingLine
  90. *
  91. * @param string $pricingLine
  92. *
  93. * @return IntangibleDiscountDetail
  94. */
  95. public function setPricingLine($pricingLine = null)
  96. {
  97. $this->pricingLine = $pricingLine;
  98. return $this;
  99. }
  100. /**
  101. * Get pricingLine
  102. *
  103. * @return string
  104. */
  105. public function getPricingLine()
  106. {
  107. return $this->pricingLine;
  108. }
  109. /**
  110. * Set price
  111. *
  112. * @param float $price
  113. *
  114. * @return IntangibleDiscountDetail
  115. */
  116. public function setPrice($price)
  117. {
  118. $this->price = floatval($price);
  119. return $this;
  120. }
  121. /**
  122. * Get price
  123. *
  124. * @return float
  125. */
  126. public function getPrice()
  127. {
  128. return $this->price;
  129. }
  130. /**
  131. * Set intangiblePriceAndDiscount
  132. *
  133. * @param \AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount
  134. *
  135. * @return IntangibleDiscountDetail
  136. */
  137. public function setIntangiblePriceAndDiscount(\AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount)
  138. {
  139. $this->intangiblePriceAndDiscount = $intangiblePriceAndDiscount;
  140. return $this;
  141. }
  142. /**
  143. * Get intangiblePriceAndDiscount
  144. *
  145. * @return \AppBundle\Entity\Product\IntangiblePriceAndDiscount
  146. */
  147. public function getIntangiblePriceAndDiscount()
  148. {
  149. return $this->intangiblePriceAndDiscount;
  150. }
  151. /**
  152. * Set residenceArea
  153. *
  154. * @param \AppBundle\Entity\Billing\ResidenceArea $residenceArea
  155. *
  156. * @return IntangibleDiscountDetail
  157. */
  158. public function setResidenceArea(\AppBundle\Entity\Billing\ResidenceArea $residenceArea = null)
  159. {
  160. $this->residenceArea = $residenceArea;
  161. return $this;
  162. }
  163. /**
  164. * Get residenceArea
  165. *
  166. * @return \AppBundle\Entity\Billing\ResidenceArea
  167. */
  168. public function getResidenceArea()
  169. {
  170. return $this->residenceArea;
  171. }
  172. /**
  173. * Set familyQuotient
  174. *
  175. * @param \AppBundle\Entity\Billing\FamilyQuotient $familyQuotient
  176. *
  177. * @return IntangibleDiscountDetail
  178. */
  179. public function setFamilyQuotient(\AppBundle\Entity\Billing\FamilyQuotient $familyQuotient = null)
  180. {
  181. $this->familyQuotient = $familyQuotient;
  182. return $this;
  183. }
  184. /**
  185. * Get familyQuotient
  186. *
  187. * @return \AppBundle\Entity\Billing\FamilyQuotient
  188. */
  189. public function getFamilyQuotient()
  190. {
  191. return $this->familyQuotient;
  192. }
  193. }