src/Entity/Session.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SessionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SessionRepository::class)
  9.  */
  10. class Session
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="date")
  20.      */
  21.     private $start_date;
  22.     /**
  23.      * @ORM\Column(type="date")
  24.      */
  25.     private $end_date;
  26.     /**
  27.      * @ORM\Column(type="date",nullable="true")
  28.      */
  29.     private $exam;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=Status::class, inversedBy="sessions")
  32.      */
  33.     private $status;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=Site::class, inversedBy="sessions")
  36.      * @ORM\JoinColumn(nullable=false)
  37.      */
  38.     private $site;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=Formation::class, inversedBy="sessions")
  41.      * @ORM\JoinColumn(nullable=false)
  42.      */
  43.     private $formation;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Inscrit::class, mappedBy="session")
  46.      */
  47.     private $inscrits;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=Demande::class, mappedBy="session")
  50.      */
  51.     private $demandes;
  52.     /**
  53.      * @ORM\Column(type="float")
  54.      */
  55.     private $pricepersonal;
  56.     /**
  57.      * @ORM\Column(type="float")
  58.      */
  59.     private $pricecompany;
  60.     /**
  61.      * @ORM\Column(type="float")
  62.      */
  63.     private $pricecpf;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Diplome::class, mappedBy="session")
  66.      */
  67.     private $diplomes;
  68.     /**
  69.      * @ORM\ManyToMany(targetEntity=Formateur::class, inversedBy="sessions")
  70.      */
  71.     private $formateur;
  72.     /**
  73.      * @ORM\Column(type="float", nullable=true)
  74.      */
  75.     private $priceexamen;
  76.      /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $presidentjury;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $secondjury;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity=LigneDevis::class, mappedBy="session")
  86.      */
  87.     private $ligneDevis;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=Uvemargementhead::class, mappedBy="session")
  90.      */
  91.     private $uvemargementheads;
  92.     /**
  93.      * @ORM\OneToMany(targetEntity=Evaluation::class, mappedBy="session")
  94.      */
  95.     private $evaluations;
  96.     /**
  97.      * @ORM\OneToMany(targetEntity=DemandeDevisLigne::class, mappedBy="session")
  98.      */
  99.     private $demandeDevisLignes;
  100.     /**
  101.      * @ORM\OneToOne(targetEntity=EntretientMacsst::class, mappedBy="session", cascade={"persist", "remove"})
  102.      */
  103.     private $entretientMacsst;
  104.     /**
  105.      * @ORM\Column(type="boolean", nullable=true)
  106.      */
  107.     private $sessionExterne;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity=ReglementParticulier::class, mappedBy="session")
  110.      */
  111.     private $reglementParticuliers;
  112.     /**
  113.      * @ORM\OneToMany(targetEntity="App\Entity\SessionPlanFormation", mappedBy="session", cascade={"persist", "remove"})
  114.      */
  115.     private $sessionPlanFormations;
  116.     public function __construct()
  117.     {
  118.         $this->inscrits = new ArrayCollection();
  119.         $this->demandes = new ArrayCollection();
  120.         $this->diplomes = new ArrayCollection();
  121.         $this->formateur = new ArrayCollection();
  122.         $this->ligneDevis = new ArrayCollection();
  123.         $this->uvemargementheads = new ArrayCollection();
  124.         $this->evaluations = new ArrayCollection();
  125.         $this->demandeDevisLignes = new ArrayCollection();
  126.         $this->reglementParticuliers = new ArrayCollection();
  127.         $this->sessionPlanFormations = new ArrayCollection();
  128.     }
  129.     public function getId(): ?int
  130.     {
  131.         return $this->id;
  132.     }
  133.     public function getStartDate(): ?\DateTimeInterface
  134.     {
  135.         return $this->start_date;
  136.     }
  137.     public function setStartDate(\DateTimeInterface $start_date): self
  138.     {
  139.         $this->start_date $start_date;
  140.         return $this;
  141.     }
  142.     public function getEndDate(): ?\DateTimeInterface
  143.     {
  144.         return $this->end_date;
  145.     }
  146.     public function setEndDate(\DateTimeInterface $end_date): self
  147.     {
  148.         $this->end_date $end_date;
  149.         return $this;
  150.     }
  151.     public function getExam(): ?\DateTimeInterface
  152.     {
  153.         return $this->exam;
  154.     }
  155.     public function setExam(\DateTimeInterface $exam): self
  156.     {
  157.         $this->exam $exam;
  158.         return $this;
  159.     }
  160.     public function getStatus(): ?Status
  161.     {
  162.         return $this->status;
  163.     }
  164.     public function setStatus(?Status $status): self
  165.     {
  166.         $this->status $status;
  167.         return $this;
  168.     }
  169.     public function getSite(): ?Site
  170.     {
  171.         return $this->site;
  172.     }
  173.     public function setSite(?Site $site): self
  174.     {
  175.         $this->site $site;
  176.         return $this;
  177.     }
  178.     public function getFormation(): ?Formation
  179.     {
  180.         return $this->formation;
  181.     }
  182.     public function setFormation(?Formation $formation): self
  183.     {
  184.         $this->formation $formation;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, Inscrit>
  189.      */
  190.     public function getInscrits(): Collection
  191.     {
  192.         return $this->inscrits;
  193.     }
  194.     public function addInscrit(Inscrit $inscrit): self
  195.     {
  196.         if (!$this->inscrits->contains($inscrit)) {
  197.             $this->inscrits[] = $inscrit;
  198.             $inscrit->setSession($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeInscrit(Inscrit $inscrit): self
  203.     {
  204.         if ($this->inscrits->removeElement($inscrit)) {
  205.             // set the owning side to null (unless already changed)
  206.             if ($inscrit->getSession() === $this) {
  207.                 $inscrit->setSession(null);
  208.             }
  209.         }
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return Collection<int, Demande>
  214.      */
  215.     public function getDemandes(): Collection
  216.     {
  217.         return $this->demandes;
  218.     }
  219.     public function addDemande(Demande $demande): self
  220.     {
  221.         if (!$this->demandes->contains($demande)) {
  222.             $this->demandes[] = $demande;
  223.             $demande->setSession($this);
  224.         }
  225.         return $this;
  226.     }
  227.     public function removeDemande(Demande $demande): self
  228.     {
  229.         if ($this->demandes->removeElement($demande)) {
  230.             // set the owning side to null (unless already changed)
  231.             if ($demande->getSession() === $this) {
  232.                 $demande->setSession(null);
  233.             }
  234.         }
  235.         return $this;
  236.     }
  237.     public function getPricepersonal(): ?float
  238.     {
  239.         return $this->pricepersonal;
  240.     }
  241.     public function setPricepersonal(float $pricepersonal): self
  242.     {
  243.         $this->pricepersonal $pricepersonal;
  244.         return $this;
  245.     }
  246.     public function getPricecompany(): ?float
  247.     {
  248.         return $this->pricecompany;
  249.     }
  250.     public function setPricecompany(float $pricecompany): self
  251.     {
  252.         $this->pricecompany $pricecompany;
  253.         return $this;
  254.     }
  255.     public function getPricecpf(): ?float
  256.     {
  257.         return $this->pricecpf;
  258.     }
  259.     public function setPricecpf(float $pricecpf): self
  260.     {
  261.         $this->pricecpf $pricecpf;
  262.         return $this;
  263.     }
  264.     /**
  265.      * @return Collection<int, Diplome>
  266.      */
  267.     public function getDiplomes(): Collection
  268.     {
  269.         return $this->diplomes;
  270.     }
  271.     public function addDiplome(Diplome $diplome): self
  272.     {
  273.         if (!$this->diplomes->contains($diplome)) {
  274.             $this->diplomes[] = $diplome;
  275.             $diplome->setSession($this);
  276.         }
  277.         return $this;
  278.     }
  279.     public function removeDiplome(Diplome $diplome): self
  280.     {
  281.         if ($this->diplomes->removeElement($diplome)) {
  282.             // set the owning side to null (unless already changed)
  283.             if ($diplome->getSession() === $this) {
  284.                 $diplome->setSession(null);
  285.             }
  286.         }
  287.         return $this;
  288.     }
  289.     /**
  290.      * @return Collection<int, Formateur>
  291.      */
  292.     public function getFormateur(): Collection
  293.     {
  294.         return $this->formateur;
  295.     }
  296.     public function addFormateur(Formateur $formateur): self
  297.     {
  298.         if (!$this->formateur->contains($formateur)) {
  299.             $this->formateur[] = $formateur;
  300.         }
  301.         return $this;
  302.     }
  303.     public function removeFormateur(Formateur $formateur): self
  304.     {
  305.         $this->formateur->removeElement($formateur);
  306.         return $this;
  307.     }
  308.     public function getPriceexamen(): ?float
  309.     {
  310.         return $this->priceexamen;
  311.     }
  312.     public function setPriceexamen(?float $priceexamen): self
  313.     {
  314.         $this->priceexamen $priceexamen;
  315.         return $this;
  316.     }
  317.     public function getPresidentjury(): ?string
  318.     {
  319.         return $this->presidentjury;
  320.     }
  321.     public function setPresidentjury(?string $presidentjury): self
  322.     {
  323.         $this->presidentjury $presidentjury;
  324.         return $this;
  325.     }
  326.     public function getSecondjury(): ?string
  327.     {
  328.         return $this->secondjury;
  329.     }
  330.     public function setSecondjury(?string $secondjury): self
  331.     {
  332.         $this->secondjury $secondjury;
  333.         return $this;
  334.     }
  335.     /**
  336.      * @return Collection<int, LigneDevis>
  337.      */
  338.     public function getLigneDevis(): Collection
  339.     {
  340.         return $this->ligneDevis;
  341.     }
  342.     public function addLigneDevi(LigneDevis $ligneDevi): self
  343.     {
  344.         if (!$this->ligneDevis->contains($ligneDevi)) {
  345.             $this->ligneDevis[] = $ligneDevi;
  346.             $ligneDevi->setSession($this);
  347.         }
  348.         return $this;
  349.     }
  350.     public function removeLigneDevi(LigneDevis $ligneDevi): self
  351.     {
  352.         if ($this->ligneDevis->removeElement($ligneDevi)) {
  353.             // set the owning side to null (unless already changed)
  354.             if ($ligneDevi->getSession() === $this) {
  355.                 $ligneDevi->setSession(null);
  356.             }
  357.         }
  358.         
  359.         return $this;        
  360.     }
  361.     public function __toString()
  362.     {
  363.         return $this->start_date->format('d/m/Y') ." "$this->end_date->format('d/m/Y') ." ";
  364.     }
  365.     /**
  366.      * @return Collection<int, Uvemargementhead>
  367.      */
  368.     public function getUvemargementheads(): Collection
  369.     {
  370.         return $this->uvemargementheads;
  371.     }
  372.     public function addUvemargementhead(Uvemargementhead $uvemargementhead): self
  373.     {
  374.         if (!$this->uvemargementheads->contains($uvemargementhead)) {
  375.             $this->uvemargementheads[] = $uvemargementhead;
  376.             $uvemargementhead->setSession($this);
  377.         }
  378.         return $this;
  379.     }
  380.     public function removeUvemargementhead(Uvemargementhead $uvemargementhead): self
  381.     {
  382.         if ($this->uvemargementheads->removeElement($uvemargementhead)) {
  383.             // set the owning side to null (unless already changed)
  384.             if ($uvemargementhead->getSession() === $this) {
  385.                 $uvemargementhead->setSession(null);
  386.             }
  387.         }
  388.         return $this;
  389.     }
  390.     /**
  391.      * @return Collection<int, Evaluation>
  392.      */
  393.     public function getEvaluations(): Collection
  394.     {
  395.         return $this->evaluations;
  396.     }
  397.     public function addEvaluation(Evaluation $evaluation): self
  398.     {
  399.         if (!$this->evaluations->contains($evaluation)) {
  400.             $this->evaluations[] = $evaluation;
  401.             $evaluation->setSession($this);
  402.         }
  403.         return $this;
  404.     }
  405.     public function removeEvaluation(Evaluation $evaluation): self
  406.     {
  407.         if ($this->evaluations->removeElement($evaluation)) {
  408.             // set the owning side to null (unless already changed)
  409.             if ($evaluation->getSession() === $this) {
  410.                 $evaluation->setSession(null);
  411.             }
  412.         }
  413.         return $this;
  414.     }
  415.     /**
  416.      * @return Collection<int, DemandeDevisLigne>
  417.      */
  418.     public function getDemandeDevisLignes(): Collection
  419.     {
  420.         return $this->demandeDevisLignes;
  421.     }
  422.     public function addDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
  423.     {
  424.         if (!$this->demandeDevisLignes->contains($demandeDevisLigne)) {
  425.             $this->demandeDevisLignes[] = $demandeDevisLigne;
  426.             $demandeDevisLigne->setSession($this);
  427.         }
  428.         return $this;
  429.     }
  430.     public function removeDemandeDevisLigne(DemandeDevisLigne $demandeDevisLigne): self
  431.     {
  432.         if ($this->demandeDevisLignes->removeElement($demandeDevisLigne)) {
  433.             // set the owning side to null (unless already changed)
  434.             if ($demandeDevisLigne->getSession() === $this) {
  435.                 $demandeDevisLigne->setSession(null);
  436.             }
  437.         }
  438.         return $this;
  439.     }
  440.     public function getEntretientMacsst(): ?EntretientMacsst
  441.     {
  442.         return $this->entretientMacsst;
  443.     }
  444.     public function setEntretientMacsst(EntretientMacsst $entretientMacsst): self
  445.     {
  446.         // set the owning side of the relation if necessary
  447.         if ($entretientMacsst->getSession() !== $this) {
  448.             $entretientMacsst->setSession($this);
  449.         }
  450.         $this->entretientMacsst $entretientMacsst;
  451.         return $this;
  452.     }
  453.     public function isSessionExterne(): ?bool
  454.     {
  455.         return $this->sessionExterne;
  456.     }
  457.     public function setSessionExterne(?bool $sessionExterne): self
  458.     {
  459.         $this->sessionExterne $sessionExterne;
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return Collection<int, ReglementParticulier>
  464.      */
  465.     public function getReglementParticuliers(): Collection
  466.     {
  467.         return $this->reglementParticuliers;
  468.     }
  469.     public function addReglementParticulier(ReglementParticulier $reglementParticulier): self
  470.     {
  471.         if (!$this->reglementParticuliers->contains($reglementParticulier)) {
  472.             $this->reglementParticuliers[] = $reglementParticulier;
  473.             $reglementParticulier->setSession($this);
  474.         }
  475.         return $this;
  476.     }
  477.     public function removeReglementParticulier(ReglementParticulier $reglementParticulier): self
  478.     {
  479.         if ($this->reglementParticuliers->removeElement($reglementParticulier)) {
  480.             // set the owning side to null (unless already changed)
  481.             if ($reglementParticulier->getSession() === $this) {
  482.                 $reglementParticulier->setSession(null);
  483.             }
  484.         }
  485.         return $this;
  486.     }
  487.     public function addSessionPlanFormation(SessionPlanFormation $sessionPlanFormation): self
  488.     {
  489.         if (!$this->sessionPlanFormations->contains($sessionPlanFormation)) {
  490.             $this->sessionPlanFormations[] = $sessionPlanFormation;
  491.             $sessionPlanFormation->setSession($this);
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeSessionPlanFormation(SessionPlanFormation $sessionPlanFormation): self
  496.     {
  497.         if ($this->sessionPlanFormations->contains($sessionPlanFormation)) {
  498.             $this->sessionPlanFormations->removeElement($sessionPlanFormation);
  499.             // set the owning side to null to remove the reference to the Session
  500.             if ($sessionPlanFormation->getSession() === $this) {
  501.                 $sessionPlanFormation->setSession(null);
  502.             }
  503.         }
  504.         return $this;
  505.     }
  506.     public function getSessionPlanFormations(): Collection
  507.     {
  508.         return $this->sessionPlanFormations;
  509.     }
  510. }