src/Entity/Dimension.php line 12

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