src/Entity/Question.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QuestionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassQuestionRepository::class)]
  8. class Question
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\ManyToOne(inversedBy'questions')]
  17.     private ?Dimension $dimension null;
  18.     #[ORM\Column]
  19.     private ?bool $deleted null;
  20.     #[ORM\OneToMany(targetEntityReponse::class, mappedBy'question')]
  21.     private Collection $reponses;
  22.     #[ORM\Column]
  23.     private ?bool $custom null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $lang null;
  26.     #[ORM\Column]
  27.     private ?bool $hasMinimal null;
  28.     public function __construct()
  29.     {
  30.         $this->reponses = new ArrayCollection();
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): static
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getDimension(): ?Dimension
  46.     {
  47.         return $this->dimension;
  48.     }
  49.     public function setDimension(?Dimension $dimension): static
  50.     {
  51.         $this->dimension $dimension;
  52.         return $this;
  53.     }
  54.     public function isDeleted(): ?bool
  55.     {
  56.         return $this->deleted;
  57.     }
  58.     public function setDeleted(bool $deleted): static
  59.     {
  60.         $this->deleted $deleted;
  61.         return $this;
  62.     }
  63.     /**
  64.      * @return Collection<int, Reponse>
  65.      */
  66.     public function getReponses(): Collection
  67.     {
  68.         return $this->reponses;
  69.     }
  70.     public function addReponse(Reponse $reponse): static
  71.     {
  72.         if (!$this->reponses->contains($reponse)) {
  73.             $this->reponses->add($reponse);
  74.             $reponse->setQuestion($this);
  75.         }
  76.         return $this;
  77.     }
  78.     public function removeReponse(Reponse $reponse): static
  79.     {
  80.         if ($this->reponses->removeElement($reponse)) {
  81.             // set the owning side to null (unless already changed)
  82.             if ($reponse->getQuestion() === $this) {
  83.                 $reponse->setQuestion(null);
  84.             }
  85.         }
  86.         return $this;
  87.     }
  88.     public function isCustom(): ?bool
  89.     {
  90.         return $this->custom;
  91.     }
  92.     public function setCustom(bool $custom): static
  93.     {
  94.         $this->custom $custom;
  95.         return $this;
  96.     }
  97.     public function getLang(): ?string
  98.     {
  99.         return $this->lang;
  100.     }
  101.     public function setLang(string $lang): static
  102.     {
  103.         $this->lang $lang;
  104.         return $this;
  105.     }
  106.     public function isHasMinimal(): ?bool
  107.     {
  108.         return $this->hasMinimal;
  109.     }
  110.     public function setHasMinimal(bool $hasMinimal): static
  111.     {
  112.         $this->hasMinimal $hasMinimal;
  113.         return $this;
  114.     }
  115. }