<?phpnamespace App\Entity;use App\Repository\JobRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=JobRepository::class) */class Job{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\Column(type="text") */ private $description; /** * @ORM\Column(type="boolean", nullable=true) */ private $isActive; /** * @ORM\Column(type="datetime", nullable=true) */ private $createdDate; /** * @ORM\OneToMany(targetEntity=Candidature::class, mappedBy="jobPosition") */ private $candidatures; /** * @ORM\Column(type="integer", nullable=true) */ private $legacyId; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\Column(type="integer", nullable=true) */ private $position; public function __construct(){ $this->createdDate = new \Datetime(); $this->updatedAt = new \DateTime(); $this->candidatures = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; return $this; } public function getCreatedDate(): ?\DateTimeInterface { return $this->createdDate; } public function setCreatedDate(?\DateTimeInterface $createdDate): self { $this->createdDate = $createdDate; return $this; } /** * @return Collection|Candidature[] */ public function getCandidatures(): Collection { return $this->candidatures; } public function addCandidature(Candidature $candidature): self { if (!$this->candidatures->contains($candidature)) { $this->candidatures[] = $candidature; $candidature->setJobPosition($this); } return $this; } public function removeCandidature(Candidature $candidature): self { if ($this->candidatures->removeElement($candidature)) { // set the owning side to null (unless already changed) if ($candidature->getJobPosition() === $this) { $candidature->setJobPosition(null); } } return $this; } public function getLegacyId(): ?int { return $this->legacyId; } public function setLegacyId(?int $legacyId): self { $this->legacyId = $legacyId; return $this; } /** * @ORM\PreUpdate */ public function setUpdatedAtValue() { $this->updatedAt = new \DateTime(); } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function getPosition(): ?int { return $this->position; } public function setPosition(?int $position): self { $this->position = $position; return $this; }}