src/Entity/SousQuestion.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SousQuestionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SousQuestionRepository::class)
  9.  */
  10. class SousQuestion
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=QuestionTestB1::class, inversedBy="sousQuestions")
  20.      */
  21.     private $questionJoin;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=PropositionReponse::class, mappedBy="sousQuestion")
  24.      */
  25.     private $propositionReponseofSousquestion;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $wording;
  30.     public function __construct()
  31.     {
  32.         $this->propositionReponseofSousquestion = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getQuestionJoin(): ?QuestionTestB1
  39.     {
  40.         return $this->questionJoin;
  41.     }
  42.     public function setQuestionJoin(?QuestionTestB1 $questionJoin): self
  43.     {
  44.         $this->questionJoin $questionJoin;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, PropositionReponse>
  49.      */
  50.     public function getPropositionReponseofSousquestion(): Collection
  51.     {
  52.         return $this->propositionReponseofSousquestion;
  53.     }
  54.     public function addPropositionReponseofSousquestion(PropositionReponse $propositionReponseofSousquestion): self
  55.     {
  56.         if (!$this->propositionReponseofSousquestion->contains($propositionReponseofSousquestion)) {
  57.             $this->propositionReponseofSousquestion[] = $propositionReponseofSousquestion;
  58.             $propositionReponseofSousquestion->setSousQuestion($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removePropositionReponseofSousquestion(PropositionReponse $propositionReponseofSousquestion): self
  63.     {
  64.         if ($this->propositionReponseofSousquestion->removeElement($propositionReponseofSousquestion)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($propositionReponseofSousquestion->getSousQuestion() === $this) {
  67.                 $propositionReponseofSousquestion->setSousQuestion(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72.     public function getWording(): ?string
  73.     {
  74.         return $this->wording;
  75.     }
  76.     public function setWording(string $wording): self
  77.     {
  78.         $this->wording $wording;
  79.         return $this;
  80.     }
  81. }