<?php
namespace App\Entity;
use App\Repository\QuestionTestB1Repository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=QuestionTestB1Repository::class)
* @Vich\Uploadable
*/
class QuestionTestB1
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="text")
*/
private $content;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @Vich\UploadableField(mapping="image_question", fileNameProperty="image")
*/
private $fichier;
/**
* @ORM\Column(type="float")
*/
private $points;
/**
* @ORM\ManyToOne(targetEntity=TypeQuestion::class, inversedBy="questionTestB1s")
*/
private $typeQuestion;
/**
* @ORM\ManyToOne(targetEntity=CategorieQuestion::class, inversedBy="questionTestB1s")
*/
private $categorie;
/**
* @ORM\OneToMany(targetEntity=PropositionReponse::class, mappedBy="questionTestb1")
*/
private $propositionReponses;
/**
* @ORM\OneToMany(targetEntity=ReponsePersonne::class, mappedBy="question")
*/
private $reponsePersonnes;
/**
* @ORM\ManyToMany(targetEntity=TestB1::class, mappedBy="questionTest")
*/
private $testB1s;
/**
* @ORM\ManyToMany(targetEntity=EpreuveTestb1::class, mappedBy="questiontestb1")
*/
private $epreuveTestb1s;
/**
* @ORM\OneToMany(targetEntity=SousQuestion::class, mappedBy="questionJoin")
*/
private $sousQuestions;
public function __toString()
{
return $this->id;
}
public function __construct()
{
$this->propositionReponses = new ArrayCollection();
$this->reponsePersonnes = new ArrayCollection();
$this->testB1s = new ArrayCollection();
// $this->evaluationTestb1s = new ArrayCollection();
$this->epreuveTestb1s = new ArrayCollection();
$this->sousQuestions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getPoints(): ?float
{
return $this->points;
}
public function setPoints(float $points): self
{
$this->points = $points;
return $this;
}
public function getTypeQuestion(): ?TypeQuestion
{
return $this->typeQuestion;
}
public function setTypeQuestion(?TypeQuestion $typeQuestion): self
{
$this->typeQuestion = $typeQuestion;
return $this;
}
public function getCategorie(): ?CategorieQuestion
{
return $this->categorie;
}
public function setCategorie(?CategorieQuestion $categorie): self
{
$this->categorie = $categorie;
return $this;
}
/**
* @return Collection<int, PropositionReponse>
*/
public function getPropositionReponses(): Collection
{
return $this->propositionReponses;
}
public function addPropositionReponse(PropositionReponse $propositionReponse): self
{
if (!$this->propositionReponses->contains($propositionReponse)) {
$this->propositionReponses[] = $propositionReponse;
$propositionReponse->setQuestionTestb1($this);
}
return $this;
}
public function removePropositionReponse(PropositionReponse $propositionReponse): self
{
if ($this->propositionReponses->removeElement($propositionReponse)) {
// set the owning side to null (unless already changed)
if ($propositionReponse->getQuestionTestb1() === $this) {
$propositionReponse->setQuestionTestb1(null);
}
}
return $this;
}
/**
* @return Collection<int, ReponsePersonne>
*/
public function getReponsePersonnes(): Collection
{
return $this->reponsePersonnes;
}
public function addReponsePersonne(ReponsePersonne $reponsePersonne): self
{
if (!$this->reponsePersonnes->contains($reponsePersonne)) {
$this->reponsePersonnes[] = $reponsePersonne;
$reponsePersonne->setQuestion($this);
}
return $this;
}
public function removeReponsePersonne(ReponsePersonne $reponsePersonne): self
{
if ($this->reponsePersonnes->removeElement($reponsePersonne)) {
// set the owning side to null (unless already changed)
if ($reponsePersonne->getQuestion() === $this) {
$reponsePersonne->setQuestion(null);
}
}
return $this;
}
/**
* @return Collection<int, TestB1>
*/
public function getTestB1s(): Collection
{
return $this->testB1s;
}
public function addTestB1(TestB1 $testB1): self
{
if (!$this->testB1s->contains($testB1)) {
$this->testB1s[] = $testB1;
$testB1->addQuestionTest($this);
}
return $this;
}
public function removeTestB1(TestB1 $testB1): self
{
if ($this->testB1s->removeElement($testB1)) {
$testB1->removeQuestionTest($this);
}
return $this;
}
public function setFichier(?File $image = null)
{
$this->fichier = $image;
if ($image) {
//$this->updateAt = new \DateTimeImmutable();
}
}
public function getFichier()
{
return $this->fichier;
}
/**
* @return Collection<int, EpreuveTestb1>
*/
public function getEpreuveTestb1s(): Collection
{
return $this->epreuveTestb1s;
}
public function addEpreuveTestb1(EpreuveTestb1 $epreuveTestb1): self
{
if (!$this->epreuveTestb1s->contains($epreuveTestb1)) {
$this->epreuveTestb1s[] = $epreuveTestb1;
$epreuveTestb1->addQuestiontestb1($this);
}
return $this;
}
public function removeEpreuveTestb1(EpreuveTestb1 $epreuveTestb1): self
{
if ($this->epreuveTestb1s->removeElement($epreuveTestb1)) {
$epreuveTestb1->removeQuestiontestb1($this);
}
return $this;
}
/**
* @return Collection<int, SousQuestion>
*/
public function getSousQuestions(): Collection
{
return $this->sousQuestions;
}
public function addSousQuestion(SousQuestion $sousQuestion): self
{
if (!$this->sousQuestions->contains($sousQuestion)) {
$this->sousQuestions[] = $sousQuestion;
$sousQuestion->setQuestionJoin($this);
}
return $this;
}
public function removeSousQuestion(SousQuestion $sousQuestion): self
{
if ($this->sousQuestions->removeElement($sousQuestion)) {
// set the owning side to null (unless already changed)
if ($sousQuestion->getQuestionJoin() === $this) {
$sousQuestion->setQuestionJoin(null);
}
}
return $this;
}
}