src/Entity/CategorieQuestion.php line 13

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