<?php
namespace App\Entity;
use App\Repository\SessionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SessionRepository::class)
*/
class Session
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="date")
*/
private $start_date;
/**
* @ORM\Column(type="date")
*/
private $end_date;
/**
* @ORM\Column(type="date",nullable="true")
*/
private $exam;
/**
* @ORM\ManyToOne(targetEntity=Status::class, inversedBy="sessions")
*/
private $status;
/**
* @ORM\ManyToOne(targetEntity=Site::class, inversedBy="sessions")
* @ORM\JoinColumn(nullable=false)
*/
private $site;
/**
* @ORM\ManyToOne(targetEntity=Formation::class, inversedBy="sessions")
* @ORM\JoinColumn(nullable=false)
*/
private $formation;
/**
* @ORM\OneToMany(targetEntity=Inscrit::class, mappedBy="session")
*/
private $inscrits;
/**
* @ORM\OneToMany(targetEntity=Demande::class, mappedBy="session")
*/
private $demandes;
/**
* @ORM\Column(type="float")
*/
private $pricepersonal;
/**
* @ORM\Column(type="float")
*/
private $pricecompany;
/**
* @ORM\Column(type="float")
*/
private $pricecpf;
/**
* @ORM\OneToMany(targetEntity=Diplome::class, mappedBy="session")
*/
private $diplomes;
/**
* @ORM\ManyToMany(targetEntity=Formateur::class, inversedBy="sessions")
*/
private $formateur;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $priceexamen;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $presidentjury;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $secondjury;
/**
* @ORM\OneToMany(targetEntity=LigneDevis::class, mappedBy="session")
*/
private $ligneDevis;
/**
* @ORM\OneToMany(targetEntity=Uvemargementhead::class, mappedBy="session")
*/
private $uvemargementheads;
/**
* @ORM\OneToMany(targetEntity=Evaluation::class, mappedBy="session")
*/
private $evaluations;
/**
* @ORM\OneToMany(targetEntity=DemandeDevisLigne::class, mappedBy="session")
*/
private $demandeDevisLignes;
/**
* @ORM\OneToOne(targetEntity=EntretientMacsst::class, mappedBy="session", cascade={"persist", "remove"})
*/
private $entretientMacsst;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $sessionExterne;
/**
* @ORM\OneToMany(targetEntity=ReglementParticulier::class, mappedBy="session")
*/
private $reglementParticuliers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SessionPlanFormation", mappedBy="session", cascade={"persist", "remove"})
*/
private $sessionPlanFormations;
public function __construct()
{
$this->inscrits = new ArrayCollection();
$this->demandes = new ArrayCollection();
$this->diplomes = new ArrayCollection();
$this->formateur = new ArrayCollection();
$this->ligneDevis = new ArrayCollection();
$this->uvemargementheads = new ArrayCollection();
$this->evaluations = new ArrayCollection();
$this->demandeDevisLignes = new ArrayCollection();
$this->reglementParticuliers = new ArrayCollection();
$this->sessionPlanFormations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->start_date;
}
public function setStartDate(\DateTimeInterface $start_date): self
{
$this->start_date = $start_date;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->end_date;
}
public function setEndDate(\DateTimeInterface $end_date): self
{
$this->end_date = $end_date;
return $this;
}
public function getExam(): ?\DateTimeInterface
{
return $this->exam;
}
public function setExam(\DateTimeInterface $exam): self
{
$this->exam = $exam;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
public function getSite(): ?Site
{
return $this->site;
}
public function setSite(?Site $site): self
{
$this->site = $site;
return $this;
}
public function getFormation(): ?Formation
{
return $this->formation;
}
public function setFormation(?Formation $formation): self
{
$this->formation = $formation;
return $this;
}
/**
* @return Collection<int, Inscrit>
*/
public function getInscrits(): Collection
{
return $this->inscrits;
}
public function addInscrit(Inscrit $inscrit): self
{
if (!$this->inscrits->contains($inscrit)) {
$this->inscrits[] = $inscrit;
$inscrit->setSession($this);
}
return $this;
}
public function removeInscrit(Inscrit $inscrit): self
{
if ($this->inscrits->removeElement($inscrit)) {
// set the owning side to null (unless already changed)
if ($inscrit->getSession() === $this) {
$inscrit->setSession(null);
}
}
return $this;
}
/**
* @return Collection<int, Demande>
*/
public function getDemandes(): Collection
{
return $this->demandes;
}
public function addDemande(Demande $demande): self
{
if (!$this->demandes->contains($demande)) {
$this->demandes[] = $demande;
$demande->setSession($this);
}
return $this;
}
public function removeDemande(Demande $demande): self
{
if ($this->demandes->removeElement($demande)) {
// set the owning side to null (unless already changed)
if ($demande->getSession() === $this) {
$demande->setSession(null);
}
}
return $this;
}
public function getPricepersonal(): ?float
{
return $this->pricepersonal;
}
public function setPricepersonal(float $pricepersonal): self
{
$this->pricepersonal = $pricepersonal;
return $this;
}
public function getPricecompany(): ?float
{
return $this->pricecompany;
}
public function setPricecompany(float $pricecompany): self
{
$this->pricecompany = $pricecompany;
return $this;
}
public function getPricecpf(): ?float
{
return $this->pricecpf;
}
public function setPricecpf(float $pricecpf): self
{
$this->pricecpf = $pricecpf;
return $this;
}
/**
* @return Collection<int, Diplome>
*/
public function getDiplomes(): Collection
{
return $this->diplomes;
}
public function addDiplome(Diplome $diplome): self
{
if (!$this->diplomes->contains($diplome)) {
$this->diplomes[] = $diplome;
$diplome->setSession($this);
}
return $this;
}
public function removeDiplome(Diplome $diplome): self
{
if ($this->diplomes->removeElement($diplome)) {
// set the owning side to null (unless already changed)
if ($diplome->getSession() === $this) {
$diplome->setSession(null);
}
}
return $this;
}
/**
* @return Collection<int, Formateur>
*/
public function getFormateur(): Collection
{
return $this->formateur;
}
public function addFormateur(Formateur $formateur): self
{
if (!$this->formateur->contains($formateur)) {
$this->formateur[] = $formateur;
}
return $this;
}
public function removeFormateur(Formateur $formateur): self
{
$this->formateur->removeElement($formateur);
return $this;
}
public function getPriceexamen(): ?float
{
return $this->priceexamen;
}
public function setPriceexamen(?float $priceexamen): self
{
$this->priceexamen = $priceexamen;
return $this;
}
public function getPresidentjury(): ?string
{
return $this->presidentjury;
}
public function setPresidentjury(?string $presidentjury): self
{
$this->presidentjury = $presidentjury;
return $this;
}
public function getSecondjury(): ?string
{
return $this->secondjury;
}
public function setSecondjury(?string $secondjury): self
{
$this->secondjury = $secondjury;
return $this;
}
/**
* @return Collection<int, LigneDevis>
*/
public function getLigneDevis(): Collection
{
return $this->ligneDevis;
}
public function addLigneDevi(LigneDevis $ligneDevi): self
{
if (!$this->ligneDevis->contains($ligneDevi)) {
$this->ligneDevis[] = $ligneDevi;
$ligneDevi->setSession($this);
}
return $this;
}
public function removeLigneDevi(LigneDevis $ligneDevi): self
{
if ($this->ligneDevis->removeElement($ligneDevi)) {
// set the owning side to null (unless already changed)
if ($ligneDevi->getSession() === $this) {
$ligneDevi->setSession(null);
}
}
return $this;
}
public function __toString()
{
return $this->start_date->format('d/m/Y') ." ". $this->end_date->format('d/m/Y') ." ";
}
/**
* @return Collection<int, Uvemargementhead>
*/
public function getUvemargementheads(): Collection
{
return $this->uvemargementheads;
}
public function addUvemargementhead(Uvemargementhead $uvemargementhead): self
{
if (!$this->uvemargementheads->contains($uvemargementhead)) {
$this->uvemargementheads[] = $uvemargementhead;
$uvemargementhead->setSession($this);
}
return $this;
}
public function removeUvemargementhead(Uvemargementhead $uvemargementhead): self
{
if ($this->uvemargementheads->removeElement($uvemargementhead)) {
// set the owning side to null (unless already changed)
if ($uvemargementhead->getSession() === $this) {
$uvemargementhead->setSession(null);
}
}
return $this;
}
/**
* @return Collection<int, Evaluation>
*/
public function getEvaluations(): Collection
{
return $this->evaluations;
}
public function addEvaluation(Evaluation $evaluation): self
{
if (!$this->evaluations->contains($evaluation)) {
$this->evaluations[] = $evaluation;
$evaluation->setSession($this);
}
return $this;
}
public function removeEvaluation(Evaluation $evaluation): self
{
if ($this->evaluations->removeElement($evaluation)) {
// set the owning side to null (unless already changed)
if ($evaluation->getSession() === $this) {
$evaluation->setSession(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandeDevisLigne>
*/
public function getDemandeDevisLignes(): Collection
{
return $this->demandeDevisLignes;
}
public function addDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
{
if (!$this->demandeDevisLignes->contains($demandeDevisLigne)) {
$this->demandeDevisLignes[] = $demandeDevisLigne;
$demandeDevisLigne->setSession($this);
}
return $this;
}
public function removeDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
{
if ($this->demandeDevisLignes->removeElement($demandeDevisLigne)) {
// set the owning side to null (unless already changed)
if ($demandeDevisLigne->getSession() === $this) {
$demandeDevisLigne->setSession(null);
}
}
return $this;
}
public function getEntretientMacsst(): ?EntretientMacsst
{
return $this->entretientMacsst;
}
public function setEntretientMacsst(EntretientMacsst $entretientMacsst): self
{
// set the owning side of the relation if necessary
if ($entretientMacsst->getSession() !== $this) {
$entretientMacsst->setSession($this);
}
$this->entretientMacsst = $entretientMacsst;
return $this;
}
public function isSessionExterne(): ?bool
{
return $this->sessionExterne;
}
public function setSessionExterne(?bool $sessionExterne): self
{
$this->sessionExterne = $sessionExterne;
return $this;
}
/**
* @return Collection<int, ReglementParticulier>
*/
public function getReglementParticuliers(): Collection
{
return $this->reglementParticuliers;
}
public function addReglementParticulier(ReglementParticulier $reglementParticulier): self
{
if (!$this->reglementParticuliers->contains($reglementParticulier)) {
$this->reglementParticuliers[] = $reglementParticulier;
$reglementParticulier->setSession($this);
}
return $this;
}
public function removeReglementParticulier(ReglementParticulier $reglementParticulier): self
{
if ($this->reglementParticuliers->removeElement($reglementParticulier)) {
// set the owning side to null (unless already changed)
if ($reglementParticulier->getSession() === $this) {
$reglementParticulier->setSession(null);
}
}
return $this;
}
public function addSessionPlanFormation(SessionPlanFormation $sessionPlanFormation): self
{
if (!$this->sessionPlanFormations->contains($sessionPlanFormation)) {
$this->sessionPlanFormations[] = $sessionPlanFormation;
$sessionPlanFormation->setSession($this);
}
return $this;
}
public function removeSessionPlanFormation(SessionPlanFormation $sessionPlanFormation): self
{
if ($this->sessionPlanFormations->contains($sessionPlanFormation)) {
$this->sessionPlanFormations->removeElement($sessionPlanFormation);
// set the owning side to null to remove the reference to the Session
if ($sessionPlanFormation->getSession() === $this) {
$sessionPlanFormation->setSession(null);
}
}
return $this;
}
public function getSessionPlanFormations(): Collection
{
return $this->sessionPlanFormations;
}
}