<?phpnamespace App\Entity;use App\Repository\CandidatureRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CandidatureRepository::class) */class Candidature{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=Profile::class, inversedBy="candidatures") * @ORM\JoinColumn(onDelete="CASCADE") */ private $profile; /** * @ORM\ManyToOne(targetEntity=Offer::class, inversedBy="candidatures") * @ORM\JoinColumn(onDelete="CASCADE") */ private $offer; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ private $postulate_at; /** * @ORM\Column(type="json", nullable=true) */ private $answers = []; public function getId(): ?int { return $this->id; } public function getProfile(): ?Profile { return $this->profile; } public function setProfile(?Profile $profile): self { $this->profile = $profile; return $this; } public function getOffer(): ?Offer { return $this->offer; } public function setOffer(?Offer $offer): self { $this->offer = $offer; return $this; } public function getPostulateAt(): ?\DateTimeImmutable { return $this->postulate_at; } public function setPostulateAt(?\DateTimeImmutable $postulate_at): self { $this->postulate_at = $postulate_at; return $this; } /** * @ORM\PrePersist */ public function setPostulateAtAutomatically() { if ($this->getPostulateAt() === null) { $this->setPostulateAt(new \DateTimeImmutable()); } } public function getAnswers(): ?array { return $this->answers; } public function setAnswers(?array $answers): self { $this->answers = $answers; return $this; }}