SddRegie.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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 regie
  13. *
  14. *
  15. * @Iri("http://schema.org/Jvs")
  16. */
  17. #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Billing\Repository\SddRegieRepository')]
  18. class SddRegie
  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(['sddregie'])]
  29. private $id;
  30. /**
  31. * @var ArrayCollection<Bill>
  32. */
  33. #[ORM\OneToMany(targetEntity: 'Bill', mappedBy: 'sddRegie', orphanRemoval: true)]
  34. private $bills;
  35. /**
  36. * @var \DateTime
  37. */
  38. #[ORM\Column(type: 'date', nullable: true)]
  39. #[Assert\Date]
  40. #[Groups(['sddregie'])]
  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(['sddregie'])]
  49. private $file;
  50. /**
  51. * @var File
  52. */
  53. #[Assert\Valid]
  54. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Core\File', cascade: ['persist'], fetch: 'EAGER')]
  55. #[ORM\JoinColumn(nullable: true)]
  56. #[Groups(['sddregie'])]
  57. private $bordereau;
  58. /**
  59. * @var \DateTime
  60. */
  61. #[ORM\Column(type: 'date', nullable: true)]
  62. #[Assert\Date]
  63. private $samplingDate;
  64. /**
  65. * The constructor
  66. */
  67. public function __construct() {
  68. $this->bills = new ArrayCollection();
  69. }
  70. /**
  71. * Sets id.
  72. *
  73. * @param int $id
  74. *
  75. * @return $this
  76. */
  77. public function setId($id)
  78. {
  79. $this->id = $id;
  80. return $this;
  81. }
  82. /**
  83. * Gets id.
  84. *
  85. * @return int
  86. */
  87. public function getId()
  88. {
  89. return $this->id;
  90. }
  91. /**
  92. * Set date
  93. *
  94. * @param \DateTime $date
  95. *
  96. * @return Pes
  97. */
  98. public function setDate($date)
  99. {
  100. $this->date = $date;
  101. return $this;
  102. }
  103. /**
  104. * Get date
  105. *
  106. * @return \DateTime
  107. */
  108. public function getDate()
  109. {
  110. return $this->date;
  111. }
  112. /**
  113. * Set file
  114. *
  115. * @param \AppBundle\Entity\Core\File $file
  116. *
  117. * @return Pes
  118. */
  119. public function setFile(\AppBundle\Entity\Core\File $file = null)
  120. {
  121. $this->file = $file;
  122. return $this;
  123. }
  124. /**
  125. * Get $bordereau
  126. *
  127. * @return \AppBundle\Entity\Core\File
  128. */
  129. public function getBordereau()
  130. {
  131. return $this->bordereau;
  132. }
  133. /**
  134. * Set $bordereau
  135. *
  136. * @param \AppBundle\Entity\Core\File $bordereau
  137. *
  138. * @return Pes
  139. */
  140. public function setBordereau(\AppBundle\Entity\Core\File $bordereau = null)
  141. {
  142. $this->bordereau = $bordereau;
  143. return $this;
  144. }
  145. /**
  146. * Get file
  147. *
  148. * @return \AppBundle\Entity\Core\File
  149. */
  150. public function getFile()
  151. {
  152. return $this->file;
  153. }
  154. /**
  155. * Add bill
  156. *
  157. * @param \AppBundle\Entity\Billing\Bill $bill
  158. *
  159. * @return Pes
  160. */
  161. public function addBill(\AppBundle\Entity\Billing\Bill $bill)
  162. {
  163. $this->bills[] = $bill;
  164. return $this;
  165. }
  166. /**
  167. * Remove bill
  168. *
  169. * @param \AppBundle\Entity\Billing\Bill $bill
  170. */
  171. public function removeBill(\AppBundle\Entity\Billing\Bill $bill)
  172. {
  173. $this->bills->removeElement($bill);
  174. }
  175. /**
  176. * Get bills
  177. *
  178. * @return \Doctrine\Common\Collections\Collection
  179. */
  180. public function getBills()
  181. {
  182. return $this->bills;
  183. }
  184. /**
  185. * Set samplingDate
  186. *
  187. * @param \DateTime $samplingDate
  188. *
  189. * @return Pes
  190. */
  191. public function setSamplingDate($samplingDate)
  192. {
  193. $this->samplingDate = $samplingDate;
  194. return $this;
  195. }
  196. /**
  197. * Get samplingDate
  198. *
  199. * @return \DateTime
  200. */
  201. public function getSamplingDate()
  202. {
  203. return $this->samplingDate;
  204. }
  205. }