src/Entity/Job.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JobRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=JobRepository::class)
  9. */
  10. class Job
  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 $title;
  22. /**
  23. * @ORM\Column(type="text")
  24. */
  25. private $description;
  26. /**
  27. * @ORM\Column(type="boolean", nullable=true)
  28. */
  29. private $isActive;
  30. /**
  31. * @ORM\Column(type="datetime", nullable=true)
  32. */
  33. private $createdDate;
  34. /**
  35. * @ORM\OneToMany(targetEntity=Candidature::class, mappedBy="jobPosition")
  36. */
  37. private $candidatures;
  38. /**
  39. * @ORM\Column(type="integer", nullable=true)
  40. */
  41. private $legacyId;
  42. /**
  43. * @ORM\Column(type="datetime", nullable=true)
  44. */
  45. private $updatedAt;
  46. /**
  47. * @ORM\Column(type="integer", nullable=true)
  48. */
  49. private $position;
  50. public function __construct(){
  51. $this->createdDate = new \Datetime();
  52. $this->updatedAt = new \DateTime();
  53. $this->candidatures = new ArrayCollection();
  54. }
  55. public function getId(): ?int
  56. {
  57. return $this->id;
  58. }
  59. public function getTitle(): ?string
  60. {
  61. return $this->title;
  62. }
  63. public function setTitle(string $title): self
  64. {
  65. $this->title = $title;
  66. return $this;
  67. }
  68. public function getDescription(): ?string
  69. {
  70. return $this->description;
  71. }
  72. public function setDescription(string $description): self
  73. {
  74. $this->description = $description;
  75. return $this;
  76. }
  77. public function getIsActive(): ?bool
  78. {
  79. return $this->isActive;
  80. }
  81. public function setIsActive(?bool $isActive): self
  82. {
  83. $this->isActive = $isActive;
  84. return $this;
  85. }
  86. public function getCreatedDate(): ?\DateTimeInterface
  87. {
  88. return $this->createdDate;
  89. }
  90. public function setCreatedDate(?\DateTimeInterface $createdDate): self
  91. {
  92. $this->createdDate = $createdDate;
  93. return $this;
  94. }
  95. /**
  96. * @return Collection|Candidature[]
  97. */
  98. public function getCandidatures(): Collection
  99. {
  100. return $this->candidatures;
  101. }
  102. public function addCandidature(Candidature $candidature): self
  103. {
  104. if (!$this->candidatures->contains($candidature)) {
  105. $this->candidatures[] = $candidature;
  106. $candidature->setJobPosition($this);
  107. }
  108. return $this;
  109. }
  110. public function removeCandidature(Candidature $candidature): self
  111. {
  112. if ($this->candidatures->removeElement($candidature)) {
  113. // set the owning side to null (unless already changed)
  114. if ($candidature->getJobPosition() === $this) {
  115. $candidature->setJobPosition(null);
  116. }
  117. }
  118. return $this;
  119. }
  120. public function getLegacyId(): ?int
  121. {
  122. return $this->legacyId;
  123. }
  124. public function setLegacyId(?int $legacyId): self
  125. {
  126. $this->legacyId = $legacyId;
  127. return $this;
  128. }
  129. /**
  130. * @ORM\PreUpdate
  131. */
  132. public function setUpdatedAtValue()
  133. {
  134. $this->updatedAt = new \DateTime();
  135. }
  136. public function getUpdatedAt(): ?\DateTimeInterface
  137. {
  138. return $this->updatedAt;
  139. }
  140. public function getPosition(): ?int
  141. {
  142. return $this->position;
  143. }
  144. public function setPosition(?int $position): self
  145. {
  146. $this->position = $position;
  147. return $this;
  148. }
  149. }