<?php
namespace App\Entity;
use App\Repository\QuestionariIniziatiRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: QuestionariIniziatiRepository::class)]
class QuestionariIniziati
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Questionari::class, inversedBy: 'questionariIniziatis')]
#[ORM\JoinColumn(nullable: false)]
private $questionario;
#[ORM\ManyToOne(targetEntity: UsersAmbienti::class, inversedBy: 'questionariIniziatis')]
private $ambiente;
#[ORM\Column(type: 'string', length: 255)]
private $user_id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $user_email_hash;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $user_email;
#[ORM\Column(type: 'integer')]
private $status;
#[ORM\Column(type: 'integer')]
private $last_question;
#[ORM\Column(type: 'datetime_immutable')]
private $created_at;
#[ORM\Column(type: 'datetime_immutable')]
private $modified_at;
#[ORM\Column(type: 'text', nullable: true)]
private $returnurl;
#[ORM\OneToMany(mappedBy: 'questionario_iniziato', targetEntity: Risposte::class)]
private $rispostes;
public function __construct()
{
$this->rispostes = new ArrayCollection();
}
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 getAmbiente(): ?UsersAmbienti
{
return $this->ambiente;
}
public function setAmbiente(?UsersAmbienti $ambiente): self
{
$this->ambiente = $ambiente;
return $this;
}
public function getUserId(): ?string
{
return $this->user_id;
}
public function setUserId(string $user_id): self
{
$this->user_id = $user_id;
return $this;
}
public function getUserEmailHash(): ?string
{
return $this->user_email_hash;
}
public function setUserEmailHash(?string $user_email_hash): self
{
$this->user_email_hash = $user_email_hash;
return $this;
}
public function getUserEmail(): ?string
{
return $this->user_email;
}
public function setUserEmail(?string $user_email): self
{
$this->user_email = $user_email;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getLastQuestion(): ?int
{
return $this->last_question;
}
public function setLastQuestion(int $last_question): self
{
$this->last_question = $last_question;
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 getModifiedAt(): ?\DateTimeImmutable
{
return $this->modified_at;
}
public function setModifiedAt(\DateTimeImmutable $modified_at): self
{
$this->modified_at = $modified_at;
return $this;
}
public function getReturnurl(): ?string
{
return $this->returnurl;
}
public function setReturnurl(?string $returnurl): self
{
$this->returnurl = $returnurl;
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->setQuestionarioIniziato($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->getQuestionarioIniziato() === $this) {
$risposte->setQuestionarioIniziato(null);
}
}
return $this;
}
}