src/Entity/Domande.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DomandeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDomandeRepository::class)]
  8. class Domande
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityQuestionari::class, inversedBy'domandes')]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private $questionario;
  17.     #[ORM\Column(type'text')]
  18.     private $domanda;
  19.     #[ORM\Column(type'text')]
  20.     private $tipo_risposta;
  21.     #[ORM\Column(type'text'nullabletrue)]
  22.     private $opzioni_risposta;
  23.     #[ORM\Column(type'boolean')]
  24.     private $multipla;
  25.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'domandes')]
  26.     private $dipende_da;
  27.     #[ORM\OneToMany(mappedBy'dipende_da'targetEntityself::class)]
  28.     private $domandes;
  29.     #[ORM\Column(type'integer')]
  30.     private $posizione;
  31.     #[ORM\Column(type'datetime_immutable')]
  32.     private $created_at;
  33.     #[ORM\Column(type'string'length255nullabletrue)]
  34.     private $placeholder;
  35.     #[ORM\Column(type'boolean')]
  36.     private $obbligatoria;
  37.     #[ORM\OneToMany(mappedBy'domanda'targetEntityRisposte::class)]
  38.     private $rispostes;
  39.     public function __construct()
  40.     {
  41.         $this->domandes = new ArrayCollection();
  42.         $this->rispostes = new ArrayCollection();
  43.     }
  44.     
  45.     public function __toString()
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getQuestionario(): ?Questionari
  54.     {
  55.         return $this->questionario;
  56.     }
  57.     public function setQuestionario(?Questionari $questionario): self
  58.     {
  59.         $this->questionario $questionario;
  60.         return $this;
  61.     }
  62.     public function getDomanda(): ?string
  63.     {
  64.         return $this->domanda;
  65.     }
  66.     public function setDomanda(string $domanda): self
  67.     {
  68.         $this->domanda $domanda;
  69.         return $this;
  70.     }
  71.     public function getTipoRisposta(): ?string
  72.     {
  73.         return $this->tipo_risposta;
  74.     }
  75.     public function setTipoRisposta(string $tipo_risposta): self
  76.     {
  77.         $this->tipo_risposta $tipo_risposta;
  78.         return $this;
  79.     }
  80.     public function getOpzioniRisposta(): ?string
  81.     {
  82.         return $this->opzioni_risposta;
  83.     }
  84.     public function setOpzioniRisposta(?string $opzioni_risposta): self
  85.     {
  86.         $this->opzioni_risposta $opzioni_risposta;
  87.         return $this;
  88.     }
  89.     public function isMultipla(): ?bool
  90.     {
  91.         return $this->multipla;
  92.     }
  93.     public function setMultipla(bool $multipla): self
  94.     {
  95.         $this->multipla $multipla;
  96.         return $this;
  97.     }
  98.     public function getDipendeDa(): ?self
  99.     {
  100.         return $this->dipende_da;
  101.     }
  102.     public function setDipendeDa(?self $dipende_da): self
  103.     {
  104.         $this->dipende_da $dipende_da;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, self>
  109.      */
  110.     public function getDomandes(): Collection
  111.     {
  112.         return $this->domandes;
  113.     }
  114.     public function addDomande(self $domande): self
  115.     {
  116.         if (!$this->domandes->contains($domande)) {
  117.             $this->domandes[] = $domande;
  118.             $domande->setDipendeDa($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeDomande(self $domande): self
  123.     {
  124.         if ($this->domandes->removeElement($domande)) {
  125.             // set the owning side to null (unless already changed)
  126.             if ($domande->getDipendeDa() === $this) {
  127.                 $domande->setDipendeDa(null);
  128.             }
  129.         }
  130.         return $this;
  131.     }
  132.     public function getPosizione(): ?int
  133.     {
  134.         return $this->posizione;
  135.     }
  136.     public function setPosizione(int $posizione): self
  137.     {
  138.         $this->posizione $posizione;
  139.         return $this;
  140.     }
  141.     public function getCreatedAt(): ?\DateTimeImmutable
  142.     {
  143.         return $this->created_at;
  144.     }
  145.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  146.     {
  147.         $this->created_at $created_at;
  148.         return $this;
  149.     }
  150.     public function getPlaceholder(): ?string
  151.     {
  152.         return $this->placeholder;
  153.     }
  154.     public function setPlaceholder(?string $placeholder): self
  155.     {
  156.         $this->placeholder $placeholder;
  157.         return $this;
  158.     }
  159.     public function isObbligatoria(): ?bool
  160.     {
  161.         return $this->obbligatoria;
  162.     }
  163.     public function setObbligatoria(bool $obbligatoria): self
  164.     {
  165.         $this->obbligatoria $obbligatoria;
  166.         return $this;
  167.     }
  168.     /**
  169.      * @return Collection<int, Risposte>
  170.      */
  171.     public function getRispostes(): Collection
  172.     {
  173.         return $this->rispostes;
  174.     }
  175.     public function addRisposte(Risposte $risposte): self
  176.     {
  177.         if (!$this->rispostes->contains($risposte)) {
  178.             $this->rispostes[] = $risposte;
  179.             $risposte->setDomanda($this);
  180.         }
  181.         return $this;
  182.     }
  183.     public function removeRisposte(Risposte $risposte): self
  184.     {
  185.         if ($this->rispostes->removeElement($risposte)) {
  186.             // set the owning side to null (unless already changed)
  187.             if ($risposte->getDomanda() === $this) {
  188.                 $risposte->setDomanda(null);
  189.             }
  190.         }
  191.         return $this;
  192.     }
  193. }