BillDebitBalance.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. * Trop-perçu conservé pour être reversé à la Bill suivante
  12. *
  13. * @Iri("http://schema.org/BillDebitBalance")
  14. */
  15. #[ORM\Entity]
  16. class BillDebitBalance
  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(['billdebitbalance'])]
  27. private $id;
  28. /**
  29. * @var BillingSetting
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\AccessBilling', inversedBy: 'billDebitBalances')]
  32. #[ORM\JoinColumn(nullable: false)]
  33. #[Assert\NotNull]
  34. #[Groups(['billdebitbalance'])]
  35. private $accessBilling;
  36. /**
  37. *
  38. * @var BillPayment
  39. */
  40. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\BillPayment', inversedBy: 'billDebitBalances', cascade: ['persist'])]
  41. #[ORM\JoinColumn(nullable: false)]
  42. #[Assert\NotNull]
  43. #[Groups(['billdebitbalance'])]
  44. private $billPayment;
  45. /**
  46. * @var float
  47. */
  48. #[ORM\Column(type: 'float', nullable: true)]
  49. #[Assert\Type(type: 'float')]
  50. #[Groups(['billdebitbalance'])]
  51. private $amount;
  52. /**
  53. * @var bool
  54. */
  55. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  56. #[Assert\Type(type: 'boolean')]
  57. #[Assert\NotNull]
  58. #[Groups(['billdebitbalance'])]
  59. private $isUsed = false;
  60. /**
  61. * Constructor
  62. */
  63. public function __construct()
  64. {
  65. $this->accessBilling = new ArrayCollection();
  66. }
  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 amount
  90. *
  91. * @param float $amount
  92. *
  93. * @return BillDebitBalance
  94. */
  95. public function setAmount($amount)
  96. {
  97. $this->amount = $amount;
  98. return $this;
  99. }
  100. /**
  101. * Get amount
  102. *
  103. * @return float
  104. */
  105. public function getAmount()
  106. {
  107. return $this->amount;
  108. }
  109. /**
  110. * Set accessBilling
  111. *
  112. * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
  113. *
  114. * @return BillDebitBalance
  115. */
  116. public function setAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling)
  117. {
  118. $this->accessBilling = $accessBilling;
  119. return $this;
  120. }
  121. /**
  122. * Get accessBilling
  123. *
  124. * @return \AppBundle\Entity\Billing\AccessBilling
  125. */
  126. public function getAccessBilling()
  127. {
  128. return $this->accessBilling;
  129. }
  130. /**
  131. * Set billPayment
  132. *
  133. * @param \AppBundle\Entity\Billing\BillPayment $billPayment
  134. *
  135. * @return BillDebitBalance
  136. */
  137. public function setBillPayment(\AppBundle\Entity\Billing\BillPayment $billPayment)
  138. {
  139. $this->billPayment = $billPayment;
  140. return $this;
  141. }
  142. /**
  143. * Get billPayment
  144. *
  145. * @return \AppBundle\Entity\Billing\BillPayment
  146. */
  147. public function getBillPayment()
  148. {
  149. return $this->billPayment;
  150. }
  151. /**
  152. * Set isUsed
  153. *
  154. * @param boolean $isUsed
  155. *
  156. * @return BillDebitBalance
  157. */
  158. public function setIsUsed($isUsed)
  159. {
  160. $this->isUsed = $isUsed;
  161. return $this;
  162. }
  163. /**
  164. * Get isUsed
  165. *
  166. * @return boolean
  167. */
  168. public function getIsUsed()
  169. {
  170. return $this->isUsed;
  171. }
  172. }