SddBank.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use AppBundle\Entity\Core\File;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use AppBundle\Entity\Traits\TimestampableEntity;
  8. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. /**
  12. * Paramètres généraux d'un export Sdd bank
  13. *
  14. *
  15. * @Iri("http://schema.org/Jvs")
  16. */
  17. #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Billing\Repository\SddBankRepository')]
  18. class SddBank
  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(['sddbank'])]
  29. private $id;
  30. /**
  31. * @var ArrayCollection<Bill>
  32. */
  33. #[ORM\OneToMany(targetEntity: 'Bill', mappedBy: 'sddBank', orphanRemoval: true)]
  34. private $bills;
  35. /**
  36. * @var \DateTime
  37. */
  38. #[ORM\Column(type: 'date', nullable: true)]
  39. #[Assert\Date]
  40. #[Groups(['sddbank'])]
  41. private $date;
  42. /**
  43. * @var File
  44. */
  45. #[Assert\Valid]
  46. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Core\File', cascade: ['persist'], fetch: 'EAGER')]
  47. #[ORM\JoinColumn(nullable: true)]
  48. #[Groups(['sddbank'])]
  49. private $file;
  50. /**
  51. * @var \DateTime
  52. */
  53. #[ORM\Column(type: 'date', nullable: true)]
  54. #[Assert\Date]
  55. private $samplingDate;
  56. /**
  57. * The constructor
  58. */
  59. public function __construct() {
  60. $this->bills = new ArrayCollection();
  61. }
  62. /**
  63. * Sets id.
  64. *
  65. * @param int $id
  66. *
  67. * @return $this
  68. */
  69. public function setId($id)
  70. {
  71. $this->id = $id;
  72. return $this;
  73. }
  74. /**
  75. * Gets id.
  76. *
  77. * @return int
  78. */
  79. public function getId()
  80. {
  81. return $this->id;
  82. }
  83. /**
  84. * Set date
  85. *
  86. * @param \DateTime $date
  87. *
  88. * @return Pes
  89. */
  90. public function setDate($date)
  91. {
  92. $this->date = $date;
  93. return $this;
  94. }
  95. /**
  96. * Get date
  97. *
  98. * @return \DateTime
  99. */
  100. public function getDate()
  101. {
  102. return $this->date;
  103. }
  104. /**
  105. * Set file
  106. *
  107. * @param \AppBundle\Entity\Core\File $file
  108. *
  109. * @return Pes
  110. */
  111. public function setFile(\AppBundle\Entity\Core\File $file = null)
  112. {
  113. $this->file = $file;
  114. return $this;
  115. }
  116. /**
  117. * Get file
  118. *
  119. * @return \AppBundle\Entity\Core\File
  120. */
  121. public function getFile()
  122. {
  123. return $this->file;
  124. }
  125. /**
  126. * Add bill
  127. *
  128. * @param \AppBundle\Entity\Billing\Bill $bill
  129. *
  130. * @return Pes
  131. */
  132. public function addBill(\AppBundle\Entity\Billing\Bill $bill)
  133. {
  134. $this->bills[] = $bill;
  135. return $this;
  136. }
  137. /**
  138. * Remove bill
  139. *
  140. * @param \AppBundle\Entity\Billing\Bill $bill
  141. */
  142. public function removeBill(\AppBundle\Entity\Billing\Bill $bill)
  143. {
  144. $this->bills->removeElement($bill);
  145. }
  146. /**
  147. * Get bills
  148. *
  149. * @return \Doctrine\Common\Collections\Collection
  150. */
  151. public function getBills()
  152. {
  153. return $this->bills;
  154. }
  155. /**
  156. * Set samplingDate
  157. *
  158. * @param \DateTime $samplingDate
  159. *
  160. * @return Pes
  161. */
  162. public function setSamplingDate($samplingDate)
  163. {
  164. $this->samplingDate = $samplingDate;
  165. return $this;
  166. }
  167. /**
  168. * Get samplingDate
  169. *
  170. * @return \DateTime
  171. */
  172. public function getSamplingDate()
  173. {
  174. return $this->samplingDate;
  175. }
  176. }