<?phpnamespace App\Entity;use App\Repository\DomandeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DomandeRepository::class)]class Domande{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: Questionari::class, inversedBy: 'domandes')] #[ORM\JoinColumn(nullable: false)] private $questionario; #[ORM\Column(type: 'text')] private $domanda; #[ORM\Column(type: 'text')] private $tipo_risposta; #[ORM\Column(type: 'text', nullable: true)] private $opzioni_risposta; #[ORM\Column(type: 'boolean')] private $multipla; #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'domandes')] private $dipende_da; #[ORM\OneToMany(mappedBy: 'dipende_da', targetEntity: self::class)] private $domandes; #[ORM\Column(type: 'integer')] private $posizione; #[ORM\Column(type: 'datetime_immutable')] private $created_at; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $placeholder; #[ORM\Column(type: 'boolean')] private $obbligatoria; #[ORM\OneToMany(mappedBy: 'domanda', targetEntity: Risposte::class)] private $rispostes; public function __construct() { $this->domandes = new ArrayCollection(); $this->rispostes = new ArrayCollection(); } public function __toString() { return $this->id; } public function getId(): ?int { return $this->id; } public function getQuestionario(): ?Questionari { return $this->questionario; } public function setQuestionario(?Questionari $questionario): self { $this->questionario = $questionario; return $this; } public function getDomanda(): ?string { return $this->domanda; } public function setDomanda(string $domanda): self { $this->domanda = $domanda; return $this; } public function getTipoRisposta(): ?string { return $this->tipo_risposta; } public function setTipoRisposta(string $tipo_risposta): self { $this->tipo_risposta = $tipo_risposta; return $this; } public function getOpzioniRisposta(): ?string { return $this->opzioni_risposta; } public function setOpzioniRisposta(?string $opzioni_risposta): self { $this->opzioni_risposta = $opzioni_risposta; return $this; } public function isMultipla(): ?bool { return $this->multipla; } public function setMultipla(bool $multipla): self { $this->multipla = $multipla; return $this; } public function getDipendeDa(): ?self { return $this->dipende_da; } public function setDipendeDa(?self $dipende_da): self { $this->dipende_da = $dipende_da; return $this; } /** * @return Collection<int, self> */ public function getDomandes(): Collection { return $this->domandes; } public function addDomande(self $domande): self { if (!$this->domandes->contains($domande)) { $this->domandes[] = $domande; $domande->setDipendeDa($this); } return $this; } public function removeDomande(self $domande): self { if ($this->domandes->removeElement($domande)) { // set the owning side to null (unless already changed) if ($domande->getDipendeDa() === $this) { $domande->setDipendeDa(null); } } return $this; } public function getPosizione(): ?int { return $this->posizione; } public function setPosizione(int $posizione): self { $this->posizione = $posizione; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->created_at; } public function setCreatedAt(\DateTimeImmutable $created_at): self { $this->created_at = $created_at; return $this; } public function getPlaceholder(): ?string { return $this->placeholder; } public function setPlaceholder(?string $placeholder): self { $this->placeholder = $placeholder; return $this; } public function isObbligatoria(): ?bool { return $this->obbligatoria; } public function setObbligatoria(bool $obbligatoria): self { $this->obbligatoria = $obbligatoria; return $this; } /** * @return Collection<int, Risposte> */ public function getRispostes(): Collection { return $this->rispostes; } public function addRisposte(Risposte $risposte): self { if (!$this->rispostes->contains($risposte)) { $this->rispostes[] = $risposte; $risposte->setDomanda($this); } return $this; } public function removeRisposte(Risposte $risposte): self { if ($this->rispostes->removeElement($risposte)) { // set the owning side to null (unless already changed) if ($risposte->getDomanda() === $this) { $risposte->setDomanda(null); } } return $this; }}