src/Entity/Candidature.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CandidatureRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CandidatureRepository::class)
  7.  */
  8. class Candidature
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=Profile::class, inversedBy="candidatures")
  18.      * @ORM\JoinColumn(onDelete="CASCADE")
  19.      */
  20.     private $profile;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Offer::class, inversedBy="candidatures")
  23.      * @ORM\JoinColumn(onDelete="CASCADE")
  24.      */
  25.     private $offer;
  26.     /**
  27.      * @ORM\Column(type="datetime_immutable", nullable=true)
  28.      */
  29.     private $postulate_at;
  30.     /**
  31.      * @ORM\Column(type="json", nullable=true)
  32.      */
  33.     private $answers = [];
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getProfile(): ?Profile
  39.     {
  40.         return $this->profile;
  41.     }
  42.     public function setProfile(?Profile $profile): self
  43.     {
  44.         $this->profile $profile;
  45.         return $this;
  46.     }
  47.     public function getOffer(): ?Offer
  48.     {
  49.         return $this->offer;
  50.     }
  51.     public function setOffer(?Offer $offer): self
  52.     {
  53.         $this->offer $offer;
  54.         return $this;
  55.     }
  56.     public function getPostulateAt(): ?\DateTimeImmutable
  57.     {
  58.         return $this->postulate_at;
  59.     }
  60.     public function setPostulateAt(?\DateTimeImmutable $postulate_at): self
  61.     {
  62.         $this->postulate_at $postulate_at;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @ORM\PrePersist
  67.      */
  68.     public function setPostulateAtAutomatically()
  69.     {
  70.         if ($this->getPostulateAt() === null) {
  71.             $this->setPostulateAt(new \DateTimeImmutable());
  72.         }
  73.     }
  74.     public function getAnswers(): ?array
  75.     {
  76.         return $this->answers;
  77.     }
  78.     public function setAnswers(?array $answers): self
  79.     {
  80.         $this->answers $answers;
  81.         return $this;
  82.     }
  83. }