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.     
  32.     #[ORM\Column(type'integer')]
  33.     private $mostra_posizione;
  34.     #[ORM\Column(type'datetime_immutable')]
  35.     private $created_at;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private $placeholder;
  38.     #[ORM\Column(type'boolean')]
  39.     private $obbligatoria;
  40.     #[ORM\OneToMany(mappedBy'domanda'targetEntityRisposte::class)]
  41.     private $rispostes;
  42.     public function __construct()
  43.     {
  44.         $this->domandes = new ArrayCollection();
  45.         $this->rispostes = new ArrayCollection();
  46.     }
  47.     
  48.     public function __toString()
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getQuestionario(): ?Questionari
  57.     {
  58.         return $this->questionario;
  59.     }
  60.     public function setQuestionario(?Questionari $questionario): self
  61.     {
  62.         $this->questionario $questionario;
  63.         return $this;
  64.     }
  65.     public function getDomanda(): ?string
  66.     {
  67.         return $this->domanda;
  68.     }
  69.     public function setDomanda(string $domanda): self
  70.     {
  71.         $this->domanda $domanda;
  72.         return $this;
  73.     }
  74.     public function getTipoRisposta(): ?string
  75.     {
  76.         return $this->tipo_risposta;
  77.     }
  78.     public function setTipoRisposta(string $tipo_risposta): self
  79.     {
  80.         $this->tipo_risposta $tipo_risposta;
  81.         return $this;
  82.     }
  83.     public function getOpzioniRisposta(): ?string
  84.     {
  85.         return $this->opzioni_risposta;
  86.     }
  87.     public function setOpzioniRisposta(?string $opzioni_risposta): self
  88.     {
  89.         $this->opzioni_risposta $opzioni_risposta;
  90.         return $this;
  91.     }
  92.     public function isMultipla(): ?bool
  93.     {
  94.         return $this->multipla;
  95.     }
  96.     public function setMultipla(bool $multipla): self
  97.     {
  98.         $this->multipla $multipla;
  99.         return $this;
  100.     }
  101.     public function getDipendeDa(): ?self
  102.     {
  103.         return $this->dipende_da;
  104.     }
  105.     public function setDipendeDa(?self $dipende_da): self
  106.     {
  107.         $this->dipende_da $dipende_da;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, self>
  112.      */
  113.     public function getDomandes(): Collection
  114.     {
  115.         return $this->domandes;
  116.     }
  117.     public function addDomande(self $domande): self
  118.     {
  119.         if (!$this->domandes->contains($domande)) {
  120.             $this->domandes[] = $domande;
  121.             $domande->setDipendeDa($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeDomande(self $domande): self
  126.     {
  127.         if ($this->domandes->removeElement($domande)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($domande->getDipendeDa() === $this) {
  130.                 $domande->setDipendeDa(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     public function getPosizione(): ?int
  136.     {
  137.         return $this->posizione;
  138.     }
  139.     public function setPosizione(int $posizione): self
  140.     {
  141.         $this->posizione $posizione;
  142.         return $this;
  143.     }
  144.     
  145.     public function getMostraPosizione(): ?int
  146.     {
  147.         return $this->mostra_posizione;
  148.     }
  149.     public function setMostraPosizione(int $mostra_posizione): self
  150.     {
  151.         $this->mostra_posizione $mostra_posizione;
  152.         return $this;
  153.     }
  154.     public function getCreatedAt(): ?\DateTimeImmutable
  155.     {
  156.         return $this->created_at;
  157.     }
  158.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  159.     {
  160.         $this->created_at $created_at;
  161.         return $this;
  162.     }
  163.     public function getPlaceholder(): ?string
  164.     {
  165.         return $this->placeholder;
  166.     }
  167.     public function setPlaceholder(?string $placeholder): self
  168.     {
  169.         $this->placeholder $placeholder;
  170.         return $this;
  171.     }
  172.     public function isObbligatoria(): ?bool
  173.     {
  174.         return $this->obbligatoria;
  175.     }
  176.     public function setObbligatoria(bool $obbligatoria): self
  177.     {
  178.         $this->obbligatoria $obbligatoria;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return Collection<int, Risposte>
  183.      */
  184.     public function getRispostes(): Collection
  185.     {
  186.         return $this->rispostes;
  187.     }
  188.     public function addRisposte(Risposte $risposte): self
  189.     {
  190.         if (!$this->rispostes->contains($risposte)) {
  191.             $this->rispostes[] = $risposte;
  192.             $risposte->setDomanda($this);
  193.         }
  194.         return $this;
  195.     }
  196.     public function removeRisposte(Risposte $risposte): self
  197.     {
  198.         if ($this->rispostes->removeElement($risposte)) {
  199.             // set the owning side to null (unless already changed)
  200.             if ($risposte->getDomanda() === $this) {
  201.                 $risposte->setDomanda(null);
  202.             }
  203.         }
  204.         return $this;
  205.     }
  206. }