Jvs.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use AppBundle\Entity\Booking\EducationalProject;
  5. use AppBundle\Entity\Core\File;
  6. use AppBundle\Entity\Product\EquipmentLoan;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Dunglas\ApiBundle\Annotation\Iri;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use AppBundle\Entity\Traits\TimestampableEntity;
  12. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use Doctrine\Common\Collections\ArrayCollection;
  15. /**
  16. * Paramètres généraux d'un export Jvs
  17. *
  18. *
  19. * @Iri("http://schema.org/Jvs")
  20. */
  21. #[ORM\Entity]
  22. class Jvs
  23. {
  24. use TimestampableEntity;
  25. use CreatorUpdaterEntity;
  26. /**
  27. * @var int
  28. */
  29. #[ORM\Column(type: 'integer')]
  30. #[ORM\Id]
  31. #[ORM\GeneratedValue(strategy: 'AUTO')]
  32. #[Groups(['jvs', 'jvs_list', 'billaccounting_list'])]
  33. private $id;
  34. /**
  35. * @var ArrayCollection<Bill>
  36. */
  37. #[ORM\OneToMany(targetEntity: 'Bill', mappedBy: 'jvs', cascade: ['persist'], orphanRemoval: true)]
  38. #[Groups(['jvs_bills'])]
  39. private $bills;
  40. /**
  41. * @var \DateTime
  42. */
  43. #[ORM\Column(type: 'date', nullable: true)]
  44. #[Assert\Date]
  45. #[Groups(['jvs', 'jvs_list'])]
  46. private $date;
  47. /**
  48. * @var File
  49. */
  50. #[Assert\Valid]
  51. #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Core\File', cascade: ['persist'], fetch: 'EAGER')]
  52. #[ORM\JoinColumn(nullable: true)]
  53. #[Groups(['jvs', 'jvs_list'])]
  54. private $file;
  55. /**
  56. * @var \DateTime
  57. */
  58. #[ORM\Column(type: 'date', nullable: true)]
  59. #[Assert\Date]
  60. #[Groups(['jvs', 'jvs_list'])]
  61. private $samplingDate;
  62. /**
  63. * @var bool
  64. */
  65. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  66. #[Assert\Type(type: 'boolean')]
  67. #[Groups(['jvs', 'jvs_list'])]
  68. #[Assert\NotNull]
  69. private $withSampling = false;
  70. /**
  71. * The constructor
  72. */
  73. public function __construct() {
  74. $this->bills = new ArrayCollection();
  75. }
  76. /**
  77. * Sets id.
  78. *
  79. * @param int $id
  80. *
  81. * @return $this
  82. */
  83. public function setId($id)
  84. {
  85. $this->id = $id;
  86. return $this;
  87. }
  88. /**
  89. * Gets id.
  90. *
  91. * @return int
  92. */
  93. public function getId()
  94. {
  95. return $this->id;
  96. }
  97. /**
  98. * Set date
  99. *
  100. * @param \DateTime $date
  101. *
  102. * @return Pes
  103. */
  104. public function setDate($date)
  105. {
  106. $this->date = $date;
  107. return $this;
  108. }
  109. /**
  110. * Get date
  111. *
  112. * @return \DateTime
  113. */
  114. public function getDate()
  115. {
  116. return $this->date;
  117. }
  118. /**
  119. * Set file
  120. *
  121. * @param \AppBundle\Entity\Core\File $file
  122. *
  123. * @return Pes
  124. */
  125. public function setFile(\AppBundle\Entity\Core\File $file = null)
  126. {
  127. $this->file = $file;
  128. return $this;
  129. }
  130. /**
  131. * Get file
  132. *
  133. * @return \AppBundle\Entity\Core\File
  134. */
  135. public function getFile()
  136. {
  137. return $this->file;
  138. }
  139. /**
  140. * Add bill
  141. *
  142. * @param \AppBundle\Entity\Billing\Bill $bill
  143. *
  144. * @return Pes
  145. */
  146. public function addBill(\AppBundle\Entity\Billing\Bill $bill)
  147. {
  148. $this->bills[] = $bill;
  149. return $this;
  150. }
  151. /**
  152. * Remove bill
  153. *
  154. * @param \AppBundle\Entity\Billing\Bill $bill
  155. */
  156. public function removeBill(\AppBundle\Entity\Billing\Bill $bill)
  157. {
  158. $this->bills->removeElement($bill);
  159. }
  160. /**
  161. * Get bills
  162. *
  163. * @return \Doctrine\Common\Collections\Collection
  164. */
  165. public function getBills()
  166. {
  167. return $this->bills;
  168. }
  169. /**
  170. * Set samplingDate
  171. *
  172. * @param \DateTime $samplingDate
  173. *
  174. * @return Pes
  175. */
  176. public function setSamplingDate($samplingDate)
  177. {
  178. $this->samplingDate = $samplingDate;
  179. return $this;
  180. }
  181. /**
  182. * Get samplingDate
  183. *
  184. * @return \DateTime
  185. */
  186. public function getSamplingDate()
  187. {
  188. return $this->samplingDate;
  189. }
  190. /**
  191. * Set withSampling
  192. *
  193. * @param boolean $withSampling
  194. *
  195. * @return Pes
  196. */
  197. public function setWithSampling($withSampling)
  198. {
  199. $this->withSampling = $withSampling;
  200. return $this;
  201. }
  202. /**
  203. * Get withSampling
  204. *
  205. * @return boolean
  206. */
  207. public function getWithSampling()
  208. {
  209. return $this->withSampling;
  210. }
  211. }