<?php
namespace App\Entity;
use App\Repository\DimensionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DimensionRepository::class)]
class Dimension
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $icon = null;
#[ORM\Column(nullable: true)]
private ?int $sorting = null;
#[ORM\OneToMany(targetEntity: Question::class, mappedBy: 'dimension')]
private Collection $questions;
#[ORM\Column(length: 255)]
private ?string $lang = null;
#[ORM\ManyToOne(inversedBy: 'dimensions')]
private ?ReviewForm $reviewForm = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $title = null;
public function __construct()
{
$this->questions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getIcon(): ?string
{
return $this->icon;
}
public function setIcon(?string $icon): static
{
$this->icon = $icon;
return $this;
}
public function getSorting(): ?int
{
return $this->sorting;
}
public function setSorting(?int $sorting): static
{
$this->sorting = $sorting;
return $this;
}
/**
* @return Collection<int, Question>
*/
public function getQuestions(): Collection
{
return $this->questions;
}
public function addQuestion(Question $question): static
{
if (!$this->questions->contains($question)) {
$this->questions->add($question);
$question->setDimension($this);
}
return $this;
}
public function removeQuestion(Question $question): static
{
if ($this->questions->removeElement($question)) {
// set the owning side to null (unless already changed)
if ($question->getDimension() === $this) {
$question->setDimension(null);
}
}
return $this;
}
public function getLang(): ?string
{
return $this->lang;
}
public function setLang(string $lang): static
{
$this->lang = $lang;
return $this;
}
public function getReviewForm(): ?ReviewForm
{
return $this->reviewForm;
}
public function setReviewForm(?ReviewForm $reviewForm): static
{
$this->reviewForm = $reviewForm;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): static
{
$this->title = $title;
return $this;
}
}