src/Entity/QuestionTestB1.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QuestionTestB1Repository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=QuestionTestB1Repository::class) 
  11.  * @Vich\Uploadable
  12.  */
  13. class QuestionTestB1
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="text")
  23.      */
  24.     private $content;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $image
  29.     /**
  30.      * @Vich\UploadableField(mapping="image_question", fileNameProperty="image")
  31.     */
  32.     private $fichier
  33.     /**
  34.      * @ORM\Column(type="float")
  35.      */
  36.     private $points;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=TypeQuestion::class, inversedBy="questionTestB1s")
  39.      */
  40.     private $typeQuestion;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=CategorieQuestion::class, inversedBy="questionTestB1s")
  43.      */
  44.     private $categorie;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity=PropositionReponse::class, mappedBy="questionTestb1")
  47.      */
  48.     private $propositionReponses;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity=ReponsePersonne::class, mappedBy="question")
  51.      */
  52.     private $reponsePersonnes;
  53.     /**
  54.      * @ORM\ManyToMany(targetEntity=TestB1::class, mappedBy="questionTest")
  55.      */
  56.     private $testB1s;
  57.  
  58.     /**
  59.      * @ORM\ManyToMany(targetEntity=EpreuveTestb1::class, mappedBy="questiontestb1")
  60.      */
  61.     private $epreuveTestb1s;
  62.     /**
  63.      * @ORM\OneToMany(targetEntity=SousQuestion::class, mappedBy="questionJoin")
  64.      */
  65.     private $sousQuestions
  66.     public function __toString()
  67.     {
  68.         return  $this->id
  69.     }
  70.     public function __construct()
  71.     {
  72.         $this->propositionReponses = new ArrayCollection();
  73.         $this->reponsePersonnes = new ArrayCollection();
  74.         $this->testB1s = new ArrayCollection();
  75.        // $this->evaluationTestb1s = new ArrayCollection();
  76.         $this->epreuveTestb1s = new ArrayCollection();
  77.         $this->sousQuestions = new ArrayCollection();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getContent(): ?string
  84.     {
  85.         return $this->content;
  86.     }
  87.     public function setContent(string $content): self
  88.     {
  89.         $this->content $content;
  90.         return $this;
  91.     }
  92.     public function getImage(): ?string
  93.     {
  94.         return $this->image;
  95.     }
  96.     public function setImage(?string $image): self
  97.     {
  98.         $this->image $image;
  99.         return $this;
  100.     }
  101.     public function getPoints(): ?float
  102.     {
  103.         return $this->points;
  104.     }
  105.     public function setPoints(float $points): self
  106.     {
  107.         $this->points $points;
  108.         return $this;
  109.     }
  110.     public function getTypeQuestion(): ?TypeQuestion
  111.     {
  112.         return $this->typeQuestion;
  113.     }
  114.     public function setTypeQuestion(?TypeQuestion $typeQuestion): self
  115.     {
  116.         $this->typeQuestion $typeQuestion;
  117.         return $this;
  118.     }
  119.     public function getCategorie(): ?CategorieQuestion
  120.     {
  121.         return $this->categorie;
  122.     }
  123.     public function setCategorie(?CategorieQuestion $categorie): self
  124.     {
  125.         $this->categorie $categorie;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, PropositionReponse>
  130.      */
  131.     public function getPropositionReponses(): Collection
  132.     {
  133.         return $this->propositionReponses;
  134.     }
  135.     public function addPropositionReponse(PropositionReponse $propositionReponse): self
  136.     {
  137.         if (!$this->propositionReponses->contains($propositionReponse)) {
  138.             $this->propositionReponses[] = $propositionReponse;
  139.             $propositionReponse->setQuestionTestb1($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removePropositionReponse(PropositionReponse $propositionReponse): self
  144.     {
  145.         if ($this->propositionReponses->removeElement($propositionReponse)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($propositionReponse->getQuestionTestb1() === $this) {
  148.                 $propositionReponse->setQuestionTestb1(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, ReponsePersonne>
  155.      */
  156.     public function getReponsePersonnes(): Collection
  157.     {
  158.         return $this->reponsePersonnes;
  159.     }
  160.     public function addReponsePersonne(ReponsePersonne $reponsePersonne): self
  161.     {
  162.         if (!$this->reponsePersonnes->contains($reponsePersonne)) {
  163.             $this->reponsePersonnes[] = $reponsePersonne;
  164.             $reponsePersonne->setQuestion($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeReponsePersonne(ReponsePersonne $reponsePersonne): self
  169.     {
  170.         if ($this->reponsePersonnes->removeElement($reponsePersonne)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($reponsePersonne->getQuestion() === $this) {
  173.                 $reponsePersonne->setQuestion(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return Collection<int, TestB1>
  180.      */
  181.     public function getTestB1s(): Collection
  182.     {
  183.         return $this->testB1s;
  184.     }
  185.     public function addTestB1(TestB1 $testB1): self
  186.     {
  187.         if (!$this->testB1s->contains($testB1)) {
  188.             $this->testB1s[] = $testB1;
  189.             $testB1->addQuestionTest($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function removeTestB1(TestB1 $testB1): self
  194.     {
  195.         if ($this->testB1s->removeElement($testB1)) {
  196.             $testB1->removeQuestionTest($this);
  197.         }
  198.         return $this;
  199.     } 
  200.     public function setFichier(?File $image null)
  201.     {
  202.         $this->fichier $image;
  203.         if ($image) {
  204.             //$this->updateAt = new \DateTimeImmutable();
  205.         }
  206.     }
  207.     public function getFichier()
  208.     {
  209.         return $this->fichier;
  210.     }
  211.     /**
  212.      * @return Collection<int, EpreuveTestb1>
  213.      */
  214.     public function getEpreuveTestb1s(): Collection
  215.     {
  216.         return $this->epreuveTestb1s;
  217.     }
  218.     public function addEpreuveTestb1(EpreuveTestb1 $epreuveTestb1): self
  219.     {
  220.         if (!$this->epreuveTestb1s->contains($epreuveTestb1)) {
  221.             $this->epreuveTestb1s[] = $epreuveTestb1;
  222.             $epreuveTestb1->addQuestiontestb1($this);
  223.         }
  224.         return $this;
  225.     }
  226.     public function removeEpreuveTestb1(EpreuveTestb1 $epreuveTestb1): self
  227.     {
  228.         if ($this->epreuveTestb1s->removeElement($epreuveTestb1)) {
  229.             $epreuveTestb1->removeQuestiontestb1($this);
  230.         }
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return Collection<int, SousQuestion>
  235.      */
  236.     public function getSousQuestions(): Collection
  237.     {
  238.         return $this->sousQuestions;
  239.     }
  240.     public function addSousQuestion(SousQuestion $sousQuestion): self
  241.     {
  242.         if (!$this->sousQuestions->contains($sousQuestion)) {
  243.             $this->sousQuestions[] = $sousQuestion;
  244.             $sousQuestion->setQuestionJoin($this);
  245.         }
  246.         return $this;
  247.     }
  248.     public function removeSousQuestion(SousQuestion $sousQuestion): self
  249.     {
  250.         if ($this->sousQuestions->removeElement($sousQuestion)) {
  251.             // set the owning side to null (unless already changed)
  252.             if ($sousQuestion->getQuestionJoin() === $this) {
  253.                 $sousQuestion->setQuestionJoin(null);
  254.             }
  255.         }
  256.         return $this;
  257.     }
  258. }