src/Entity/TourneeTheorique.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TourneeTheoriqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTourneeTheoriqueRepository::class)]
  8. class TourneeTheorique
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $nom null;
  16.     #[ORM\ManyToOne()]
  17.     private ?TourneeTheorique $tourneeSuivante null;
  18.     #[ORM\ManyToOne(inversedBy'tourneeTheoriques')]
  19.     private ?SystemeClient $systemeClient null;
  20.     #[ORM\OneToMany(mappedBy'tournee'targetEntityTransportTheorique::class)]
  21.     private Collection $transportTheoriques;
  22.     #[ORM\Column]
  23.     private ?int $actif null;
  24.     #[ORM\Column]
  25.     private ?int $typePrix null;
  26.     #[ORM\Column]
  27.     private ?int $recurrenceValeur null;
  28.     #[ORM\Column]
  29.     private ?int $recurrenceType null;
  30.     #[ORM\OneToMany(mappedBy'tourneeTheorique'targetEntityTourneeTheoriqueJour::class)]
  31.     private Collection $tourneeTheoriqueJours;
  32.     #[ORM\Column(length10)]
  33.     private ?string $couleur null;
  34.     #[ORM\OneToMany(mappedBy'tourneeTheorique'targetEntityPlanningReccurenceJourTournee::class)]
  35.     private Collection $planningReccurenceJourTournees;
  36.     #[ORM\Column]
  37.     private ?int $ram null;
  38.     #[ORM\OneToMany(mappedBy'tourneeTheorique'targetEntityGrilleTarifairePDL::class)]
  39.     private Collection $grilleTarifairePDLs;
  40.     public function __construct()
  41.     {
  42.         $this->transportTheoriques = new ArrayCollection();
  43.         $this->tourneeTheoriqueJours = new ArrayCollection();
  44.         $this->planningReccurenceJourTournees = new ArrayCollection();
  45.         $this->grilleTarifairePDLs = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getNom(): ?string
  52.     {
  53.         return $this->nom;
  54.     }
  55.     public function getNomCode(): ?string
  56.     {
  57.         return str_replace("'","",$this->nom);
  58.     }
  59.     public function setNom(string $nom): self
  60.     {
  61.         $this->nom $nom;
  62.         return $this;
  63.     }
  64.     public function getTourneeSuivante()
  65.     {
  66.         return $this->tourneeSuivante;
  67.     }
  68.     public function setTourneeSuivante($tourneeSuivante): self
  69.     {
  70.         $this->tourneeSuivante $tourneeSuivante;
  71.         return $this;
  72.     }
  73.     public function getSystemeClient(): ?SystemeClient
  74.     {
  75.         return $this->systemeClient;
  76.     }
  77.     public function setSystemeClient(?SystemeClient $systemeClient): self
  78.     {
  79.         $this->systemeClient $systemeClient;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, TransportTheorique>
  84.      */
  85.     public function getTransportTheoriques(): Collection
  86.     {
  87.         return $this->transportTheoriques;
  88.     }
  89.     public function addTransportTheorique(TransportTheorique $transportTheorique): self
  90.     {
  91.         if (!$this->transportTheoriques->contains($transportTheorique)) {
  92.             $this->transportTheoriques->add($transportTheorique);
  93.             $transportTheorique->setTournee($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeTransportTheorique(TransportTheorique $transportTheorique): self
  98.     {
  99.         if ($this->transportTheoriques->removeElement($transportTheorique)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($transportTheorique->getTournee() === $this) {
  102.                 $transportTheorique->setTournee(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     public function __toString()
  108.     {
  109.         return $this->getNom();
  110.     }
  111.     public function getActif(): ?int
  112.     {
  113.         return $this->actif;
  114.     }
  115.     public function setActif(int $actif): self
  116.     {
  117.         $this->actif $actif;
  118.         return $this;
  119.     }
  120.     public function getTypePrix(): ?int
  121.     {
  122.         return $this->typePrix;
  123.     }
  124.     public function setTypePrix(int $typePrix): self
  125.     {
  126.         $this->typePrix $typePrix;
  127.         return $this;
  128.     }
  129.     public function getRecurrenceValeur(): ?int
  130.     {
  131.         return $this->recurrenceValeur;
  132.     }
  133.     public function setRecurrenceValeur($recurrenceValeur): self
  134.     {
  135.         $this->recurrenceValeur $recurrenceValeur;
  136.         return $this;
  137.     }
  138.     public function getRecurrenceType(): ?int
  139.     {
  140.         return $this->recurrenceType;
  141.     }
  142.     public function setRecurrenceType($recurrenceType): self
  143.     {
  144.         $this->recurrenceType $recurrenceType;
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return Collection<int, TourneeTheoriqueJour>
  149.      */
  150.     public function getTourneeTheoriqueJours(): Collection
  151.     {
  152.         return $this->tourneeTheoriqueJours;
  153.     }
  154.     public function addTourneeTheoriqueJour(TourneeTheoriqueJour $tourneeTheoriqueJour): self
  155.     {
  156.         if (!$this->tourneeTheoriqueJours->contains($tourneeTheoriqueJour)) {
  157.             $this->tourneeTheoriqueJours->add($tourneeTheoriqueJour);
  158.             $tourneeTheoriqueJour->setTourneeTheorique($this);
  159.         }
  160.         return $this;
  161.     }
  162.     public function removeTourneeTheoriqueJour(TourneeTheoriqueJour $tourneeTheoriqueJour): self
  163.     {
  164.         if ($this->tourneeTheoriqueJours->removeElement($tourneeTheoriqueJour)) {
  165.             // set the owning side to null (unless already changed)
  166.             if ($tourneeTheoriqueJour->getTourneeTheorique() === $this) {
  167.                 $tourneeTheoriqueJour->setTourneeTheorique(null);
  168.             }
  169.         }
  170.         return $this;
  171.     }
  172.     public function getTourneeTheoriqueJoursNom(): array
  173.     {
  174.         $listJourNom = array();
  175.         if(!empty($this->getTourneeTheoriqueJours()))
  176.         {
  177.             foreach($this->getTourneeTheoriqueJours() as $ttj)
  178.             {
  179.                 if($ttj->getJour()==1) {
  180.                     $listJourNom[$ttj->getJour()] = "Lundi";
  181.                 }
  182.                 else if($ttj->getJour()==2) {
  183.                     $listJourNom[$ttj->getJour()] = "Mardi";
  184.                 }
  185.                 else if($ttj->getJour()==3) {
  186.                     $listJourNom[$ttj->getJour()] = "Mercredi";
  187.                 }
  188.                 else if($ttj->getJour()==4) {
  189.                     $listJourNom[$ttj->getJour()] = "Jeudi";
  190.                 }
  191.                 else if($ttj->getJour()==5) {
  192.                     $listJourNom[$ttj->getJour()] = "Vendredi";
  193.                 }
  194.                 else if($ttj->getJour()==6) {
  195.                     $listJourNom[$ttj->getJour()] = "Samedi";
  196.                 }
  197.                 else if($ttj->getJour()==7) {
  198.                     $listJourNom[$ttj->getJour()] = "Dimanche";
  199.                 }
  200.             }
  201.             ksort($listJourNom);
  202.         }
  203.         return $listJourNom;
  204.     }
  205.     public function getCouleur(): ?string
  206.     {
  207.         return $this->couleur;
  208.     }
  209.     public function setCouleur($couleur)
  210.     {
  211.         $this->couleur $couleur;
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, PlanningReccurenceJourTournee>
  216.      */
  217.     public function getPlanningReccurenceJourTournees(): Collection
  218.     {
  219.         return $this->planningReccurenceJourTournees;
  220.     }
  221.     public function addPlanningReccurenceJourTournee(PlanningReccurenceJourTournee $planningReccurenceJourTournee): self
  222.     {
  223.         if (!$this->planningReccurenceJourTournees->contains($planningReccurenceJourTournee)) {
  224.             $this->planningReccurenceJourTournees->add($planningReccurenceJourTournee);
  225.             $planningReccurenceJourTournee->setTourneeTheorique($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removePlanningReccurenceJourTournee(PlanningReccurenceJourTournee $planningReccurenceJourTournee): self
  230.     {
  231.         if ($this->planningReccurenceJourTournees->removeElement($planningReccurenceJourTournee)) {
  232.             // set the owning side to null (unless already changed)
  233.             if ($planningReccurenceJourTournee->getTourneeTheorique() === $this) {
  234.                 $planningReccurenceJourTournee->setTourneeTheorique(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239.     public function getRam(): ?int
  240.     {
  241.         return $this->ram;
  242.     }
  243.     public function setRam(int $ram): self
  244.     {
  245.         $this->ram $ram;
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection<int, GrilleTarifairePDL>
  250.      */
  251.     public function getGrilleTarifairePDLs(): Collection
  252.     {
  253.         return $this->grilleTarifairePDLs;
  254.     }
  255.     public function addGrilleTarifairePDL(GrilleTarifairePDL $grilleTarifairePDL): self
  256.     {
  257.         if (!$this->grilleTarifairePDLs->contains($grilleTarifairePDL)) {
  258.             $this->grilleTarifairePDLs->add($grilleTarifairePDL);
  259.             $grilleTarifairePDL->setTourneeTheorique($this);
  260.         }
  261.         return $this;
  262.     }
  263.     public function removeGrilleTarifairePDL(GrilleTarifairePDL $grilleTarifairePDL): self
  264.     {
  265.         if ($this->grilleTarifairePDLs->removeElement($grilleTarifairePDL)) {
  266.             // set the owning side to null (unless already changed)
  267.             if ($grilleTarifairePDL->getTourneeTheorique() === $this) {
  268.                 $grilleTarifairePDL->setTourneeTheorique(null);
  269.             }
  270.         }
  271.         return $this;
  272.     }
  273. }