src/Entity/EmployeeContract.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmployeeContractRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=EmployeeContractRepository::class)
  9. */
  10. class EmployeeContract
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="datetime")
  20. */
  21. private $createdDate;
  22. /**
  23. * @ORM\Column(type="date", nullable=true)
  24. */
  25. private $startDate;
  26. /**
  27. * @ORM\Column(type="date", nullable=true)
  28. */
  29. private $endDate;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. private $startingCity;
  34. /**
  35. * @ORM\Column(type="string", length=255, nullable=true)
  36. */
  37. private $returnCity;
  38. /**
  39. * @ORM\ManyToOne(targetEntity=Contact::class, inversedBy="employeeContracts")
  40. * @ORM\JoinColumn(nullable=true)
  41. */
  42. private $contact;
  43. /**
  44. * @ORM\OneToMany(targetEntity=SejourSessionEquipier::class, mappedBy="employeeContract")
  45. */
  46. private $sejourSessionEquipier;
  47. public function __construct()
  48. {
  49. $this->sejourSessionEquipier = new ArrayCollection();
  50. }
  51. public function getId(): ?int
  52. {
  53. return $this->id;
  54. }
  55. public function getCreatedDate(): ?\DateTimeInterface
  56. {
  57. return $this->createdDate;
  58. }
  59. public function setCreatedDate(\DateTimeInterface $createdDate): self
  60. {
  61. $this->createdDate = $createdDate;
  62. return $this;
  63. }
  64. public function getStartDate(): ?\DateTimeInterface
  65. {
  66. return $this->startDate;
  67. }
  68. public function setStartDate(?\DateTimeInterface $startDate): self
  69. {
  70. $this->startDate = $startDate;
  71. return $this;
  72. }
  73. public function getEndDate(): ?\DateTimeInterface
  74. {
  75. return $this->endDate;
  76. }
  77. public function setEndDate(?\DateTimeInterface $endDate): self
  78. {
  79. $this->endDate = $endDate;
  80. return $this;
  81. }
  82. public function getStartingCity(): ?string
  83. {
  84. return $this->startingCity;
  85. }
  86. public function setStartingCity(?string $startingCity): self
  87. {
  88. $this->startingCity = $startingCity;
  89. return $this;
  90. }
  91. public function getReturnCity(): ?string
  92. {
  93. return $this->returnCity;
  94. }
  95. public function setReturnCity(?string $ReturnCity): self
  96. {
  97. $this->returnCity = $ReturnCity;
  98. return $this;
  99. }
  100. public function getContact(): ?Contact
  101. {
  102. return $this->contact;
  103. }
  104. public function setContact(?Contact $contact): self
  105. {
  106. $this->contact = $contact;
  107. return $this;
  108. }
  109. /**
  110. * @return Collection|SejourSessionEquipier[]
  111. */
  112. public function getSejourSessionEquipier(): Collection
  113. {
  114. return $this->sejourSessionEquipier;
  115. }
  116. public function addSejourSessionEquipier(SejourSessionEquipier $sejourSessionEquipier): self
  117. {
  118. if (!$this->sejourSessionEquipier->contains($sejourSessionEquipier)) {
  119. $this->sejourSessionEquipier[] = $sejourSessionEquipier;
  120. $sejourSessionEquipier->setEmployeeContract($this);
  121. }
  122. return $this;
  123. }
  124. public function removeSejourSessionEquipier(SejourSessionEquipier $sejourSessionEquipier): self
  125. {
  126. if ($this->sejourSessionEquipier->removeElement($sejourSessionEquipier)) {
  127. // set the owning side to null (unless already changed)
  128. if ($sejourSessionEquipier->getEmployeeContract() === $this) {
  129. $sejourSessionEquipier->setEmployeeContract(null);
  130. }
  131. }
  132. return $this;
  133. }
  134. }