<?php
namespace App\Entity;
use App\Repository\DemandeAffectationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: DemandeAffectationRepository::class)]
class DemandeAffectation
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: Tache::class)]
private $tache;
#[ORM\ManyToMany(targetEntity: AgentInterne::class)]
private Collection $conseiller;
#[ORM\OneToMany(mappedBy: 'demandeAffectation', targetEntity: DocDemandeService::class)]
private Collection $docDemandeService;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Assert\LessThanOrEqual(propertyPath: "dateFin")]
private ?\DateTimeInterface $dateDebut = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Assert\GreaterThanOrEqual(propertyPath: "dateDebut")]
private ?\DateTimeInterface $dateFin = null;
#[ORM\Column(nullable: true)]
private ?int $statut = null;
#[ORM\ManyToOne(inversedBy: 'demandeAffectation')]
private ?DemandeService $demandeService = null;
#[ORM\Column(nullable: true)]
private ?bool $deleted = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $deletedAt = null;
#[ORM\Column(nullable: true)]
private ?int $deletedBy = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateCloture = null;
#[ORM\OneToMany(mappedBy: 'demandeAffectation', targetEntity: PourcentageQuiz::class, orphanRemoval: true)]
private Collection $pourcentageQuizzes;
#[ORM\OneToMany(mappedBy: 'demandeAffectation', targetEntity: CandidatFiche::class, orphanRemoval: true)]
private Collection $candidatFiches;
#[ORM\OneToMany(mappedBy: 'demandeAffectaion', targetEntity: UserFicheSatisfaction::class, orphanRemoval: true)]
private Collection $userFicheSatisfactions;
#[ORM\Column(nullable: true)]
private ?int $nbrjour = null;
public function __construct()
{
$this->conseiller = new ArrayCollection();
$this->docDemandeService = new ArrayCollection();
$this->pourcentageQuizzes = new ArrayCollection();
$this->candidatFiches = new ArrayCollection();
$this->userFicheSatisfactions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, AgentInterne>
*/
public function getConseiller(): Collection
{
return $this->conseiller;
}
public function addConseiller(AgentInterne $conseiller): self
{
if (!$this->conseiller->contains($conseiller)) {
$this->conseiller->add($conseiller);
}
return $this;
}
public function removeConseiller(AgentInterne $conseiller): self
{
$this->conseiller->removeElement($conseiller);
return $this;
}
/**
* @return Collection<int, DocDemandeService>
*/
public function getDocDemandeService(): Collection
{
return $this->docDemandeService;
}
public function addDocDemandeService(DocDemandeService $docDemandeService): self
{
if (!$this->docDemandeService->contains($docDemandeService)) {
$this->docDemandeService->add($docDemandeService);
$docDemandeService->setDemandeAffectation($this);
}
return $this;
}
public function removeDocDemandeService(DocDemandeService $docDemandeService): self
{
if ($this->docDemandeService->removeElement($docDemandeService)) {
// set the owning side to null (unless already changed)
if ($docDemandeService->getDemandeAffectation() === $this) {
$docDemandeService->setDemandeAffectation(null);
}
}
return $this;
}
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;
}
public function getStatut(): ?int
{
return $this->statut;
}
public function setStatut(?int $statut): self
{
$this->statut = $statut;
return $this;
}
public function getDemandeService(): ?DemandeService
{
return $this->demandeService;
}
public function setDemandeService(?DemandeService $demandeService): self
{
$this->demandeService = $demandeService;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(?bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getDeletedBy(): ?int
{
return $this->deletedBy;
}
public function setDeletedBy(?int $deletedBy): self
{
$this->deletedBy = $deletedBy;
return $this;
}
public function getDateCloture(): ?\DateTimeInterface
{
return $this->dateCloture;
}
public function setDateCloture(?\DateTimeInterface $dateCloture): self
{
$this->dateCloture = $dateCloture;
return $this;
}
public function getTache(): ?Tache
{
return $this->tache;
}
public function setTache(?Tache $tache): self
{
$this->tache = $tache;
return $this;
}
/**
* @return Collection<int, PourcentageQuiz>
*/
public function getPourcentageQuizzes(): Collection
{
return $this->pourcentageQuizzes;
}
public function addPourcentageQuiz(PourcentageQuiz $pourcentageQuiz): self
{
if (!$this->pourcentageQuizzes->contains($pourcentageQuiz)) {
$this->pourcentageQuizzes->add($pourcentageQuiz);
$pourcentageQuiz->setDemandeAffectation($this);
}
return $this;
}
public function removePourcentageQuiz(PourcentageQuiz $pourcentageQuiz): self
{
if ($this->pourcentageQuizzes->removeElement($pourcentageQuiz)) {
// set the owning side to null (unless already changed)
if ($pourcentageQuiz->getDemandeAffectation() === $this) {
$pourcentageQuiz->setDemandeAffectation(null);
}
}
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->setDemandeAffectation($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->getDemandeAffectation() === $this) {
$candidatFich->setDemandeAffectation(null);
}
}
return $this;
}
/**
* @return Collection<int, UserFicheSatisfaction>
*/
public function getUserFicheSatisfactions(): Collection
{
return $this->userFicheSatisfactions;
}
public function addUserFicheSatisfaction(UserFicheSatisfaction $userFicheSatisfaction): self
{
if (!$this->userFicheSatisfactions->contains($userFicheSatisfaction)) {
$this->userFicheSatisfactions->add($userFicheSatisfaction);
$userFicheSatisfaction->setDemandeAffectaion($this);
}
return $this;
}
public function removeUserFicheSatisfaction(UserFicheSatisfaction $userFicheSatisfaction): self
{
if ($this->userFicheSatisfactions->removeElement($userFicheSatisfaction)) {
// set the owning side to null (unless already changed)
if ($userFicheSatisfaction->getDemandeAffectaion() === $this) {
$userFicheSatisfaction->setDemandeAffectaion(null);
}
}
return $this;
}
public function getNbrjour(): ?int
{
return $this->nbrjour;
}
public function setNbrjour(?int $nbrjour): self
{
$this->nbrjour = $nbrjour;
return $this;
}
}