src/Entity/Questionari.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\QuestionariRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassQuestionariRepository::class)]
  9. class Questionari
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255)]
  16.     private $titolo;
  17.     #[ORM\Column(type'text'nullabletrue)]
  18.     private $descrizione;
  19.     #[ORM\Column(type'datetime_immutable')]
  20.     private $created_at;
  21.     #[ORM\ManyToOne(targetEntityUsers::class, inversedBy'questionaris')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private $user;
  24.     #[ORM\OneToMany(mappedBy'questionario'targetEntityDomande::class, orphanRemovaltrue)]
  25.     private $domandes;
  26.     #[ORM\ManyToOne(targetEntityUsersAmbienti::class, inversedBy'questionaris')]
  27.     private $ambiente;
  28.     #[ORM\Column(type'integer'nullabletrue)]
  29.     private $corso_id;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $corso_title;
  32.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'questionaris')]
  33.     private $questionario;
  34.     #[ORM\OneToMany(mappedBy'questionario'targetEntityself::class)]
  35.     private $questionaris;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private $token;
  38.     #[ORM\OneToMany(mappedBy'questionario'targetEntityQuestionariIniziati::class, orphanRemovaltrue)]
  39.     private $questionariIniziatis;
  40.     #[ORM\OneToMany(mappedBy'questionario'targetEntityRisposte::class)]
  41.     private $rispostes;
  42.     public function __construct()
  43.     {
  44.         $this->domandes = new ArrayCollection();
  45.         $this->questionaris = new ArrayCollection();
  46.         $this->questionariIniziatis = new ArrayCollection();
  47.         $this->rispostes = new ArrayCollection();
  48.     }
  49.     public function __toString()
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getTitolo(): ?string
  58.     {
  59.         return $this->titolo;
  60.     }
  61.     public function setTitolo(string $titolo): self
  62.     {
  63.         $this->titolo $titolo;
  64.         return $this;
  65.     }
  66.     public function getDescrizione(): ?string
  67.     {
  68.         return $this->descrizione;
  69.     }
  70.     public function setDescrizione(?string $descrizione): self
  71.     {
  72.         $this->descrizione $descrizione;
  73.         return $this;
  74.     }
  75.     public function getCreatedAt(): ?\DateTimeImmutable
  76.     {
  77.         return $this->created_at;
  78.     }
  79.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  80.     {
  81.         $this->created_at $created_at;
  82.         return $this;
  83.     }
  84.     public function getUser(): ?Users
  85.     {
  86.         return $this->user;
  87.     }
  88.     public function setUser(?Users $user): self
  89.     {
  90.         $this->user $user;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, Domande>
  95.      */
  96.     public function getDomandes(): Collection
  97.     {
  98.         return $this->domandes;
  99.     }
  100.     public function addDomande(Domande $domande): self
  101.     {
  102.         if (!$this->domandes->contains($domande)) {
  103.             $this->domandes[] = $domande;
  104.             $domande->setQuestionario($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeDomande(Domande $domande): self
  109.     {
  110.         if ($this->domandes->removeElement($domande)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($domande->getQuestionario() === $this) {
  113.                 $domande->setQuestionario(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118.     public function getAmbiente(): ?UsersAmbienti
  119.     {
  120.         return $this->ambiente;
  121.     }
  122.     public function setAmbiente(?UsersAmbienti $ambiente): self
  123.     {
  124.         $this->ambiente $ambiente;
  125.         return $this;
  126.     }
  127.     public function getCorsoId(): ?int
  128.     {
  129.         return $this->corso_id;
  130.     }
  131.     public function setCorsoId(?int $corso_id): self
  132.     {
  133.         $this->corso_id $corso_id;
  134.         return $this;
  135.     }
  136.     public function getCorsoTitle(): ?string
  137.     {
  138.         return $this->corso_title;
  139.     }
  140.     public function setCorsoTitle(?string $corso_title): self
  141.     {
  142.         $this->corso_title $corso_title;
  143.         return $this;
  144.     }
  145.     public function getQuestionario(): ?self
  146.     {
  147.         return $this->questionario;
  148.     }
  149.     public function setQuestionario(?self $questionario): self
  150.     {
  151.         $this->questionario $questionario;
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return Collection<int, self>
  156.      */
  157.     public function getQuestionaris(): Collection
  158.     {
  159.         return $this->questionaris;
  160.     }
  161.     public function addQuestionari(self $questionari): self
  162.     {
  163.         if (!$this->questionaris->contains($questionari)) {
  164.             $this->questionaris[] = $questionari;
  165.             $questionari->setQuestionario($this);
  166.         }
  167.         return $this;
  168.     }
  169.     public function removeQuestionari(self $questionari): self
  170.     {
  171.         if ($this->questionaris->removeElement($questionari)) {
  172.             // set the owning side to null (unless already changed)
  173.             if ($questionari->getQuestionario() === $this) {
  174.                 $questionari->setQuestionario(null);
  175.             }
  176.         }
  177.         return $this;
  178.     }
  179.     public function getToken(): ?string
  180.     {
  181.         return $this->token;
  182.     }
  183.     public function setToken(?string $token): self
  184.     {
  185.         $this->token $token;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return Collection<int, QuestionariIniziati>
  190.      */
  191.     public function getQuestionariIniziatis(): Collection
  192.     {
  193.         return $this->questionariIniziatis;
  194.     }
  195.     public function addQuestionariIniziati(QuestionariIniziati $questionariIniziati): self
  196.     {
  197.         if (!$this->questionariIniziatis->contains($questionariIniziati)) {
  198.             $this->questionariIniziatis[] = $questionariIniziati;
  199.             $questionariIniziati->setQuestionario($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removeQuestionariIniziati(QuestionariIniziati $questionariIniziati): self
  204.     {
  205.         if ($this->questionariIniziatis->removeElement($questionariIniziati)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($questionariIniziati->getQuestionario() === $this) {
  208.                 $questionariIniziati->setQuestionario(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection<int, Risposte>
  215.      */
  216.     public function getRispostes(): Collection
  217.     {
  218.         return $this->rispostes;
  219.     }
  220.     public function addRisposte(Risposte $risposte): self
  221.     {
  222.         if (!$this->rispostes->contains($risposte)) {
  223.             $this->rispostes[] = $risposte;
  224.             $risposte->setQuestionario($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeRisposte(Risposte $risposte): self
  229.     {
  230.         if ($this->rispostes->removeElement($risposte)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($risposte->getQuestionario() === $this) {
  233.                 $risposte->setQuestionario(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238. }