<?php
namespace App\Entity;
use App\Repository\EvaluationRepository;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EvaluationRepository::class)
*/
class Evaluation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $datedebut;
/**
* @ORM\Column(type="datetime")
*/
private $datefin;
/**
* @ORM\ManyToMany(targetEntity=Question::class, inversedBy="evaluations")
* @ORM\OrderBy({"id" = "ASC"})
*/
private $question;
/**
* @ORM\ManyToOne(targetEntity=Session::class, inversedBy="evaluations")
* @ORM\JoinColumn(nullable=false)
*/
private $session;
/**
* @ORM\OneToMany(targetEntity=EvaluationLog::class, mappedBy="evaluation")
*/
private $evaluationLogs;
/**
* @ORM\OneToMany(targetEntity=EvaluationRepondu::class, mappedBy="evaluation")
*/
private $evaluationRepondus;
/**
* @ORM\ManyToOne(targetEntity=ModuleSession::class, inversedBy="evaluations")
* @ORM\JoinColumn(nullable=true)
*/
private $modulesession;
/**
* @ORM\Column(type="boolean",nullable=true)
*/
private $envoyer;
/**
* @ORM\OneToMany(targetEntity=EvaluationEnvoyer::class, mappedBy="evaluation")
*/
private $evaluationEnvoyers;
/**
* @ORM\Column(type="text",nullable=true)
*/
private $uuid;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $created_at;
public function __construct()
{
$this->question = new ArrayCollection();
$this->evaluationLogs = new ArrayCollection();
$this->evaluationRepondus = new ArrayCollection();
$this->evaluationEnvoyers = new ArrayCollection();
$this->created_at = new DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getDatedebut(): ?\DateTimeInterface
{
return $this->datedebut;
}
public function setDatedebut(\DateTimeInterface $datedebut): self
{
$this->datedebut = $datedebut;
return $this;
}
public function getDatefin(): ?\DateTimeInterface
{
return $this->datefin;
}
public function setDatefin(\DateTimeInterface $datefin): self
{
$this->datefin = $datefin;
return $this;
}
/**
* @return Collection<int, Question>
*/
public function getQuestion(): Collection
{
return $this->question;
}
public function addQuestion(Question $question): self
{
if (!$this->question->contains($question)) {
$this->question[] = $question;
}
return $this;
}
public function removeQuestion(Question $question): self
{
$this->question->removeElement($question);
return $this;
}
public function getSession(): ?Session
{
return $this->session;
}
public function setSession(?Session $session): self
{
$this->session = $session;
return $this;
}
/**
* @return Collection<int, EvaluationLog>
*/
public function getEvaluationLogs(): Collection
{
return $this->evaluationLogs;
}
public function addEvaluationLog(EvaluationLog $evaluationLog): self
{
if (!$this->evaluationLogs->contains($evaluationLog)) {
$this->evaluationLogs[] = $evaluationLog;
$evaluationLog->setEvaluation($this);
}
return $this;
}
public function removeEvaluationLog(EvaluationLog $evaluationLog): self
{
if ($this->evaluationLogs->removeElement($evaluationLog)) {
// set the owning side to null (unless already changed)
if ($evaluationLog->getEvaluation() === $this) {
$evaluationLog->setEvaluation(null);
}
}
return $this;
}
/**
* @return Collection<int, EvaluationRepondu>
*/
public function getEvaluationRepondus(): Collection
{
return $this->evaluationRepondus;
}
public function addEvaluationRepondu(EvaluationRepondu $evaluationRepondu): self
{
if (!$this->evaluationRepondus->contains($evaluationRepondu)) {
$this->evaluationRepondus[] = $evaluationRepondu;
$evaluationRepondu->setEvaluation($this);
}
return $this;
}
public function removeEvaluationRepondu(EvaluationRepondu $evaluationRepondu): self
{
if ($this->evaluationRepondus->removeElement($evaluationRepondu)) {
// set the owning side to null (unless already changed)
if ($evaluationRepondu->getEvaluation() === $this) {
$evaluationRepondu->setEvaluation(null);
}
}
return $this;
}
public function getModuleSession(): ?ModuleSession
{
return $this->modulesession;
}
public function setModuleSession(?ModuleSession $session): self
{
$this->modulesession = $session;
return $this;
}
public function getEnvoyer(): ?bool
{
return $this->envoyer;
}
public function setEnvoyer(?bool $session): self
{
$this->envoyer = $session;
return $this;
}
/**
* @return Collection<int, EvaluationEnvoyer>
*/
public function getEvaluationEnvoyers(): Collection
{
return $this->evaluationEnvoyers;
}
public function addEvaluationEnvoyer(EvaluationEnvoyer $evaluationEnvoyer): self
{
if (!$this->evaluationEnvoyers->contains($evaluationEnvoyer)) {
$this->evaluationEnvoyers[] = $evaluationEnvoyer;
$evaluationEnvoyer->setEvaluation($this);
}
return $this;
}
public function removeEvaluationEnvoyer(EvaluationEnvoyer $evaluationEnvoyer): self
{
if ($this->evaluationEnvoyers->removeElement($evaluationEnvoyer)) {
// set the owning side to null (unless already changed)
if ($evaluationEnvoyer->getEvaluation() === $this) {
$evaluationEnvoyer->setEvaluation(null);
}
}
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $session): self
{
$this->uuid = $session;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
}