src/Entity/EnterpriseRequest.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EnterpriseRequestRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=EnterpriseRequestRepository::class)
  9. */
  10. class EnterpriseRequest
  11. {
  12. const STATE_REJECTED = "rejected";
  13. const STATE_ACCEPTED = "accepted";
  14. const STATUS_OPEN = "open";
  15. const STATUS_REJECTED = "rejected";
  16. const STATUS_ACCEPTED = "accepted";
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\ManyToOne(targetEntity=Enterprise::class, inversedBy="enterpriseRequests",cascade={"persist"})
  25. * @ORM\JoinColumn(nullable=false)
  26. */
  27. private $enterprise;
  28. /**
  29. * @ORM\OneToMany(targetEntity=EnterpriseOptionSejourSession::class, mappedBy="enterpriseRequest")
  30. */
  31. private $enterpriseOptionSejourSessions;
  32. /**
  33. * @ORM\Column(type="datetime")
  34. */
  35. private $creationDate;
  36. /**
  37. * @ORM\Column(type="string", length=255, nullable = true)
  38. */
  39. private $type;
  40. /**
  41. * @ORM\ManyToOne(targetEntity=Saison::class)
  42. * @ORM\JoinColumn(nullable=false)
  43. */
  44. private $saison;
  45. /**
  46. * @ORM\Column(type="integer")
  47. */
  48. private $ageMin;
  49. /**
  50. * @ORM\Column(type="integer")
  51. */
  52. private $ageMax;
  53. /**
  54. * @ORM\Column(type="integer")
  55. */
  56. private $nbr;
  57. /**
  58. * @ORM\Column(type="json", length=255, nullable = true)
  59. */
  60. private $hebergement;
  61. /**
  62. * @ORM\Column(type="string", length=255, nullable = true)
  63. */
  64. private $transport;
  65. /**
  66. * @ORM\Column(type="string", length=50, nullable=true)
  67. */
  68. private $statut;
  69. public function __construct()
  70. {
  71. $this->creationDate = new \DateTime();
  72. $this->statut = self::STATUS_OPEN;
  73. $this->hebergement = [];
  74. $this->enterpriseOptionSejourSessions = new ArrayCollection();
  75. }
  76. public function getId(): ?int
  77. {
  78. return $this->id;
  79. }
  80. public function getEnterprise(): ?Enterprise
  81. {
  82. return $this->enterprise;
  83. }
  84. public function setEnterprise(?Enterprise $enterprise): self
  85. {
  86. $this->enterprise = $enterprise;
  87. return $this;
  88. }
  89. public function getCreationDate(): ?\DateTimeInterface
  90. {
  91. return $this->creationDate;
  92. }
  93. public function setCreationDate(\DateTimeInterface $creationDate): self
  94. {
  95. $this->creationDate = $creationDate;
  96. return $this;
  97. }
  98. public function getType(): ?string
  99. {
  100. return $this->type;
  101. }
  102. public function setType(string $type): self
  103. {
  104. $this->type = $type;
  105. return $this;
  106. }
  107. public function getSaison(): ?Saison
  108. {
  109. return $this->saison;
  110. }
  111. public function setSaison(?Saison $saison): self
  112. {
  113. $this->saison = $saison;
  114. return $this;
  115. }
  116. public function getAgeMin(): ?int
  117. {
  118. return $this->ageMin;
  119. }
  120. public function setAgeMin(int $ageMin): self
  121. {
  122. $this->ageMin = $ageMin;
  123. return $this;
  124. }
  125. public function getAgeMax(): ?int
  126. {
  127. return $this->ageMax;
  128. }
  129. public function setAgeMax(int $ageMax): self
  130. {
  131. $this->ageMax = $ageMax;
  132. return $this;
  133. }
  134. public function getNbr(): ?int
  135. {
  136. return $this->nbr;
  137. }
  138. public function setNbr(int $nbr): self
  139. {
  140. $this->nbr = $nbr;
  141. return $this;
  142. }
  143. public function getHebergement()
  144. {
  145. return $this->hebergement;
  146. }
  147. public function setHebergement(string $hebergement): self
  148. {
  149. $this->hebergement = $hebergement;
  150. return $this;
  151. }
  152. public function getTransport(): ?string
  153. {
  154. return $this->transport;
  155. }
  156. public function setTransport(string $transport): self
  157. {
  158. $this->transport = $transport;
  159. return $this;
  160. }
  161. public function getStatut(): ?string
  162. {
  163. return $this->statut;
  164. }
  165. public function setStatut(?string $statut): self
  166. {
  167. $this->statut = $statut;
  168. return $this;
  169. }
  170. /**
  171. * @return Collection|EnterpriseOptionSejourSession[]
  172. */
  173. public function getEnterpriseOptionSejourSessions()
  174. {
  175. return $this->enterpriseOptionSejourSessions;
  176. }
  177. public function addEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  178. {
  179. if (!$this->enterpriseOptionSejourSessions->contains($enterpriseOptionSejourSession)) {
  180. $this->enterpriseOptionSejourSessions[] = $enterpriseOptionSejourSession;
  181. $enterpriseOptionSejourSession->setEnterpriseRequest($this);
  182. }
  183. return $this;
  184. }
  185. public function removeEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  186. {
  187. if ($this->enterpriseOptionSejourSessions->removeElement($enterpriseOptionSejourSession)) {
  188. // set the owning side to null (unless already changed)
  189. if ($enterpriseOptionSejourSession->getEnterprise() === $this) {
  190. $enterpriseOptionSejourSession->setEnterprise(null);
  191. }
  192. }
  193. return $this;
  194. }
  195. }