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(targetEntityResponse::class, mappedBy'question')]
  21.     private Collection $responses;
  22.     #[ORM\Column]
  23.     private ?bool $custom null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $lang null;
  26.     public function __construct()
  27.     {
  28.         $this->responses = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): static
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getDimension(): ?Dimension
  44.     {
  45.         return $this->dimension;
  46.     }
  47.     public function setDimension(?Dimension $dimension): static
  48.     {
  49.         $this->dimension $dimension;
  50.         return $this;
  51.     }
  52.     public function isDeleted(): ?bool
  53.     {
  54.         return $this->deleted;
  55.     }
  56.     public function setDeleted(bool $deleted): static
  57.     {
  58.         $this->deleted $deleted;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, Response>
  63.      */
  64.     public function getResponses(): Collection
  65.     {
  66.         return $this->responses;
  67.     }
  68.     public function addResponse(Response $response): static
  69.     {
  70.         if (!$this->responses->contains($response)) {
  71.             $this->responses->add($response);
  72.             $response->setQuestion($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeResponse(Response $response): static
  77.     {
  78.         if ($this->responses->removeElement($response)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($response->getQuestion() === $this) {
  81.                 $response->setQuestion(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     public function isCustom(): ?bool
  87.     {
  88.         return $this->custom;
  89.     }
  90.     public function setCustom(bool $custom): static
  91.     {
  92.         $this->custom $custom;
  93.         return $this;
  94.     }
  95.     public function getLang(): ?string
  96.     {
  97.         return $this->lang;
  98.     }
  99.     public function setLang(string $lang): static
  100.     {
  101.         $this->lang $lang;
  102.         return $this;
  103.     }
  104. }