<?php
namespace App\Entity;
use App\Repository\FicheEvalRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FicheEvalRepository::class)]
class FicheEval
{
const TYPE_ARRAY = [
'SATISFACTION' => 0,
'ACQUIS' => 1,
'PREREQUIS' => 2
];
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(nullable: false)]
private ?int $type = null;
#[ORM\ManyToOne(inversedBy: 'ficheEvals')]
#[ORM\JoinColumn(nullable: false)]
private ?Module $module = null;
#[ORM\Column]
private ?bool $validated = false;
#[ORM\OneToMany(mappedBy: 'fiche', targetEntity: CritereEvaluation::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection $critereEvaluations;
#[ORM\Column(length: 255, nullable: true)]
private ?string $label = null;
#[ORM\OneToMany(mappedBy: 'fiche', targetEntity: CandidatFiche::class, orphanRemoval: true)]
private Collection $candidatFiches;
public function __construct()
{
$this->critereEvaluations = new ArrayCollection();
$this->candidatFiches = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?int $type): self
{
$this->type = $type;
return $this;
}
public function getModule(): ?Module
{
return $this->module;
}
public function setModule(?Module $module): self
{
$this->module = $module;
return $this;
}
public function isValidated(): ?bool
{
return $this->validated;
}
public function setValidated(bool $validated): self
{
$this->validated = $validated;
return $this;
}
/**
* @return Collection<int, CritereEvaluation>
*/
public function getCritereEvaluations(): Collection
{
return $this->critereEvaluations;
}
public function addCritereEvaluation(CritereEvaluation $critereEvaluation): self
{
if (!$this->critereEvaluations->contains($critereEvaluation)) {
$this->critereEvaluations->add($critereEvaluation);
$critereEvaluation->setFiche($this);
}
return $this;
}
public function removeCritereEvaluation(CritereEvaluation $critereEvaluation): self
{
if ($this->critereEvaluations->removeElement($critereEvaluation)) {
// set the owning side to null (unless already changed)
if ($critereEvaluation->getFiche() === $this) {
$critereEvaluation->setFiche(null);
}
}
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(?string $label): self
{
$this->label = $label;
return $this;
}
/**
* @return Collection<int, CandidatFiche>
*/
public function getCandidatFiches(): Collection
{
return $this->candidatFiches;
}
public function addCandidatFich(CandidatFiche $candidatFich): self
{
if (!$this->candidatFiches->contains($candidatFich)) {
$this->candidatFiches->add($candidatFich);
$candidatFich->setFiche($this);
}
return $this;
}
public function removeCandidatFich(CandidatFiche $candidatFich): self
{
if ($this->candidatFiches->removeElement($candidatFich)) {
// set the owning side to null (unless already changed)
if ($candidatFich->getFiche() === $this) {
$candidatFich->setFiche(null);
}
}
return $this;
}
}