src/Entity/Enterprise.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EnterpriseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=EnterpriseRepository::class)
  9. */
  10. class Enterprise
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. private $type;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private $name;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable =true)
  28. */
  29. private $numImport;
  30. /**
  31. * @ORM\OneToOne(targetEntity=Location::class, cascade={"persist", "remove"})
  32. * @ORM\JoinColumn(nullable=false)
  33. */
  34. private $location;
  35. /**
  36. * @ORM\OneToMany(targetEntity=EnterpriseRequest::class, mappedBy="enterprise")
  37. */
  38. private $enterpriseRequests;
  39. /**
  40. * @ORM\OneToMany(targetEntity=EnterpriseOptionSejourSession::class, mappedBy="enterprise")
  41. */
  42. private $enterpriseOptionSejourSessions;
  43. /**
  44. * @ORM\OneToOne(targetEntity=Contact::class, inversedBy="enterprise", cascade={"persist", "remove"})
  45. * @ORM\JoinColumn(nullable=false)
  46. */
  47. private $contact;
  48. /**
  49. * @ORM\OneToMany(targetEntity=Reduction::class, mappedBy="enterprise")
  50. */
  51. private $reductions;
  52. /**
  53. * @ORM\OneToMany(targetEntity=ContactComment::class, mappedBy="enterprise")
  54. */
  55. private $contactComments;
  56. public function __construct()
  57. {
  58. $this->enterpriseRequests = new ArrayCollection();
  59. $this->enterpriseOptionSejourSessions = new ArrayCollection();
  60. $this->reductions = new ArrayCollection();
  61. $this->contactComments = new ArrayCollection();
  62. }
  63. public function getId(): ?int
  64. {
  65. return $this->id;
  66. }
  67. public function getType(): ?string
  68. {
  69. return $this->type;
  70. }
  71. public function setType(string $type): self
  72. {
  73. $this->type = $type;
  74. return $this;
  75. }
  76. public function getName(): ?string
  77. {
  78. return $this->name;
  79. }
  80. public function setName(string $name): self
  81. {
  82. $this->name = $name;
  83. return $this;
  84. }
  85. public function getNumImport(): ?string
  86. {
  87. return $this->numImport;
  88. }
  89. public function setNumImport(string $name): self
  90. {
  91. $this->numImport = $name;
  92. return $this;
  93. }
  94. public function getLocation(): ?Location
  95. {
  96. return $this->location;
  97. }
  98. public function setLocation(Location $location): self
  99. {
  100. $this->location = $location;
  101. return $this;
  102. }
  103. /**
  104. * @return Collection|EnterpriseRequest[]
  105. */
  106. public function getEnterpriseRequests(): Collection
  107. {
  108. return $this->enterpriseRequests;
  109. }
  110. public function addEnterpriseRequest(EnterpriseRequest $enterpriseRequest): self
  111. {
  112. if (!$this->enterpriseRequests->contains($enterpriseRequest)) {
  113. $this->enterpriseRequests[] = $enterpriseRequest;
  114. $enterpriseRequest->setEnterprise($this);
  115. }
  116. return $this;
  117. }
  118. public function removeEnterpriseRequest(EnterpriseRequest $enterpriseRequest): self
  119. {
  120. if ($this->enterpriseRequests->removeElement($enterpriseRequest)) {
  121. // set the owning side to null (unless already changed)
  122. if ($enterpriseRequest->getEnterprise() === $this) {
  123. $enterpriseRequest->setEnterprise(null);
  124. }
  125. }
  126. return $this;
  127. }
  128. /**
  129. * @return Collection|EnterpriseOptionSejourSession[]
  130. */
  131. public function getEnterpriseOptionSejourSessions(): Collection
  132. {
  133. return $this->enterpriseOptionSejourSessions;
  134. }
  135. public function addEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  136. {
  137. if (!$this->enterpriseOptionSejourSessions->contains($enterpriseOptionSejourSession)) {
  138. $this->enterpriseOptionSejourSessions[] = $enterpriseOptionSejourSession;
  139. $enterpriseOptionSejourSession->setEnterprise($this);
  140. }
  141. return $this;
  142. }
  143. public function removeEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  144. {
  145. if ($this->enterpriseOptionSejourSessions->removeElement($enterpriseOptionSejourSession)) {
  146. // set the owning side to null (unless already changed)
  147. if ($enterpriseOptionSejourSession->getEnterprise() === $this) {
  148. $enterpriseOptionSejourSession->setEnterprise(null);
  149. }
  150. }
  151. return $this;
  152. }
  153. public function getContact(): ?Contact
  154. {
  155. return $this->contact;
  156. }
  157. public function setContact(Contact $contact): self
  158. {
  159. $this->contact = $contact;
  160. return $this;
  161. }
  162. /**
  163. * @return Collection|Reduction[]
  164. */
  165. public function getReductions(): Collection
  166. {
  167. return $this->reductions;
  168. }
  169. public function addReduction(Reduction $reduction): self
  170. {
  171. if (!$this->reductions->contains($reduction)) {
  172. $this->reductions[] = $reduction;
  173. $reduction->setEnterprise($this);
  174. }
  175. return $this;
  176. }
  177. public function removeReduction(Reduction $reduction): self
  178. {
  179. if ($this->reductions->removeElement($reduction)) {
  180. // set the owning side to null (unless already changed)
  181. if ($reduction->getEnterprise() === $this) {
  182. $reduction->setEnterprise(null);
  183. }
  184. }
  185. return $this;
  186. }
  187. /**
  188. * @return Collection|ContactComment[]
  189. */
  190. public function getContactComments(): Collection
  191. {
  192. return $this->contactComments;
  193. }
  194. public function addContactComment(ContactComment $contactComment): self
  195. {
  196. if (!$this->contactComments->contains($contactComment)) {
  197. $this->contactComments[] = $contactComment;
  198. $contactComment->setEnterprise($this);
  199. }
  200. return $this;
  201. }
  202. public function removeContactComment(ContactComment $contactComment): self
  203. {
  204. if ($this->contactComments->removeElement($contactComment)) {
  205. // set the owning side to null (unless already changed)
  206. if ($contactComment->getEnterprise() === $this) {
  207. $contactComment->setEnterprise(null);
  208. }
  209. }
  210. return $this;
  211. }
  212. }