src/Entity/RecruitQuestion.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RecruitQuestionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassRecruitQuestionRepository::class)]
  9. class RecruitQuestion
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::TEXT)]
  16.     private ?string $question null;
  17.     #[ORM\Column]
  18.     private ?bool $mandatory null;
  19.     #[ORM\Column(length20)]
  20.     private ?string $type null;
  21.     #[ORM\Column]
  22.     private ?\DateTimeImmutable $createdAt null;
  23.     #[ORM\ManyToOne(inversedBy'recruitQuestions')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?User $createdBy null;
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?\DateTimeImmutable $updatedAt null;
  28.     #[ORM\ManyToOne]
  29.     private ?User $updatedBy null;
  30.     #[ORM\OneToMany(mappedBy'question'targetEntityRecruitQuestionOption::class, orphanRemovaltrue)]
  31.     private Collection $recruitQuestionOptions;
  32.     #[ORM\OneToMany(mappedBy'question'targetEntityRecruitQuestionOffice::class, orphanRemovaltrue)]
  33.     private Collection $recruitQuestionOffices;
  34.     #[ORM\OneToMany(mappedBy'question'targetEntityRecruitQuestionDepartment::class, orphanRemovaltrue)]
  35.     private Collection $recruitQuestionDepartments;
  36.     #[ORM\OneToMany(mappedBy'questionTemplate'targetEntityRecruitQuestionVacancy::class)]
  37.     private Collection $recruitQuestionVacancies;
  38.     public function __construct()
  39.     {
  40.         $this->recruitQuestionOptions = new ArrayCollection();
  41.         $this->recruitQuestionOffices = new ArrayCollection();
  42.         $this->recruitQuestionDepartments = new ArrayCollection();
  43.         $this->recruitQuestionVacancies = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getQuestion(): ?string
  50.     {
  51.         return $this->question;
  52.     }
  53.     public function setQuestion(string $question): self
  54.     {
  55.         $this->question $question;
  56.         return $this;
  57.     }
  58.     public function isMandatory(): ?bool
  59.     {
  60.         return $this->mandatory;
  61.     }
  62.     public function setMandatory(bool $mandatory): self
  63.     {
  64.         $this->mandatory $mandatory;
  65.         return $this;
  66.     }
  67.     public function getType(): ?string
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(string $type): self
  72.     {
  73.         $this->type $type;
  74.         return $this;
  75.     }
  76.     public function getCreatedAt(): ?\DateTimeImmutable
  77.     {
  78.         return $this->createdAt;
  79.     }
  80.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  81.     {
  82.         $this->createdAt $createdAt;
  83.         return $this;
  84.     }
  85.     public function getCreatedBy(): ?User
  86.     {
  87.         return $this->createdBy;
  88.     }
  89.     public function setCreatedBy(?User $createdBy): self
  90.     {
  91.         $this->createdBy $createdBy;
  92.         return $this;
  93.     }
  94.     public function getUpdatedAt(): ?\DateTimeImmutable
  95.     {
  96.         return $this->updatedAt;
  97.     }
  98.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  99.     {
  100.         $this->updatedAt $updatedAt;
  101.         return $this;
  102.     }
  103.     public function getUpdatedBy(): ?User
  104.     {
  105.         return $this->updatedBy;
  106.     }
  107.     public function setUpdatedBy(?User $updatedBy): self
  108.     {
  109.         $this->updatedBy $updatedBy;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Collection<int, RecruitQuestionOption>
  114.      */
  115.     public function getRecruitQuestionOptions(): Collection
  116.     {
  117.         return $this->recruitQuestionOptions;
  118.     }
  119.     public function addRecruitQuestionOption(RecruitQuestionOption $recruitQuestionOption): self
  120.     {
  121.         if (!$this->recruitQuestionOptions->contains($recruitQuestionOption)) {
  122.             $this->recruitQuestionOptions->add($recruitQuestionOption);
  123.             $recruitQuestionOption->setQuestion($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeRecruitQuestionOption(RecruitQuestionOption $recruitQuestionOption): self
  128.     {
  129.         if ($this->recruitQuestionOptions->removeElement($recruitQuestionOption)) {
  130.             // set the owning side to null (unless already changed)
  131.             if ($recruitQuestionOption->getQuestion() === $this) {
  132.                 $recruitQuestionOption->setQuestion(null);
  133.             }
  134.         }
  135.         return $this;
  136.     }
  137.     /**
  138.      * @return Collection<int, RecruitQuestionOffice>
  139.      */
  140.     public function getRecruitQuestionOffices(): Collection
  141.     {
  142.         return $this->recruitQuestionOffices;
  143.     }
  144.     public function addRecruitQuestionOffice(RecruitQuestionOffice $recruitQuestionOffice): self
  145.     {
  146.         if (!$this->recruitQuestionOffices->contains($recruitQuestionOffice)) {
  147.             $this->recruitQuestionOffices->add($recruitQuestionOffice);
  148.             $recruitQuestionOffice->setQuestion($this);
  149.         }
  150.         return $this;
  151.     }
  152.     public function removeRecruitQuestionOffice(RecruitQuestionOffice $recruitQuestionOffice): self
  153.     {
  154.         if ($this->recruitQuestionOffices->removeElement($recruitQuestionOffice)) {
  155.             // set the owning side to null (unless already changed)
  156.             if ($recruitQuestionOffice->getQuestion() === $this) {
  157.                 $recruitQuestionOffice->setQuestion(null);
  158.             }
  159.         }
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return Collection<int, RecruitQuestionDepartment>
  164.      */
  165.     public function getRecruitQuestionDepartments(): Collection
  166.     {
  167.         return $this->recruitQuestionDepartments;
  168.     }
  169.     public function addRecruitQuestionDepartment(RecruitQuestionDepartment $recruitQuestionDepartment): self
  170.     {
  171.         if (!$this->recruitQuestionDepartments->contains($recruitQuestionDepartment)) {
  172.             $this->recruitQuestionDepartments->add($recruitQuestionDepartment);
  173.             $recruitQuestionDepartment->setQuestion($this);
  174.         }
  175.         return $this;
  176.     }
  177.     public function removeRecruitQuestionDepartment(RecruitQuestionDepartment $recruitQuestionDepartment): self
  178.     {
  179.         if ($this->recruitQuestionDepartments->removeElement($recruitQuestionDepartment)) {
  180.             // set the owning side to null (unless already changed)
  181.             if ($recruitQuestionDepartment->getQuestion() === $this) {
  182.                 $recruitQuestionDepartment->setQuestion(null);
  183.             }
  184.         }
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, RecruitQuestionVacancy>
  189.      */
  190.     public function getRecruitQuestionVacancies(): Collection
  191.     {
  192.         return $this->recruitQuestionVacancies;
  193.     }
  194.     public function addRecruitQuestionVacancy(RecruitQuestionVacancy $recruitQuestionVacancy): self
  195.     {
  196.         if (!$this->recruitQuestionVacancies->contains($recruitQuestionVacancy)) {
  197.             $this->recruitQuestionVacancies->add($recruitQuestionVacancy);
  198.             $recruitQuestionVacancy->setQuestionTemplate($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeRecruitQuestionVacancy(RecruitQuestionVacancy $recruitQuestionVacancy): self
  203.     {
  204.         if ($this->recruitQuestionVacancies->removeElement($recruitQuestionVacancy)) {
  205.             // set the owning side to null (unless already changed)
  206.             if ($recruitQuestionVacancy->getQuestionTemplate() === $this) {
  207.                 $recruitQuestionVacancy->setQuestionTemplate(null);
  208.             }
  209.         }
  210.         return $this;
  211.     }
  212. }