src/Entity/Main/Promos.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Main;
  3. use App\Repository\PromosRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=PromosRepository::class)
  7.  */
  8. class Promos
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=128)
  18.      */
  19.     private $designation;
  20.     /**
  21.      * @ORM\Column(type="string", length=128, nullable=true)
  22.      */
  23.     private $information;
  24.     /**
  25.      * @ORM\Column(type="time", nullable=true)
  26.      */
  27.     private $heure_debut;
  28.     /**
  29.      * @ORM\Column(type="time", nullable=true)
  30.      */
  31.     private $heure_fin;
  32.     /**
  33.      * @ORM\Column(type="array", nullable=true)
  34.      */
  35.     private $jours = [];
  36.     /**
  37.      * @ORM\Column(type="integer", nullable=true)
  38.      */
  39.     private $nbre_parties;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true)
  42.      */
  43.     private $date_debut;
  44.     /**
  45.      * @ORM\Column(type="datetime", nullable=true)
  46.      */
  47.     private $date_fin;
  48.     /**
  49.      * @ORM\Column(type="string", length=64)
  50.      */
  51.     private $type_reduction;
  52.     /**
  53.      * @ORM\Column(type="float", nullable=true)
  54.      */
  55.     private $price_ttc;
  56.     /**
  57.      * @ORM\Column(type="float", nullable=true)
  58.      */
  59.     private $percent;
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=true)
  62.      */
  63.     private $priority;
  64.     
  65.     private $reduction;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity="App\Entity\Main\Forfait", inversedBy="promos")
  68.      */
  69.     private $forfait;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity="App\Entity\Main\GroupTarifs", inversedBy="prices")
  72.      */
  73.     private $groupby;
  74.     
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getDesignation(): ?string
  80.     {
  81.         return $this->designation;
  82.     }
  83.     public function setDesignation(string $designation): self
  84.     {
  85.         $this->designation $designation;
  86.         return $this;
  87.     }
  88.     public function getInformation(): ?string
  89.     {
  90.         return $this->information;
  91.     }
  92.     public function setInformation(?string $information): self
  93.     {
  94.         $this->information $information;
  95.         return $this;
  96.     }
  97.     public function getHeureDebut(): ?\DateTimeInterface
  98.     {
  99.         return $this->heure_debut;
  100.     }
  101.     public function setHeureDebut(?\DateTimeInterface $heure_debut): self
  102.     {
  103.         $this->heure_debut $heure_debut;
  104.         return $this;
  105.     }
  106.     public function getHeureFin(): ?\DateTimeInterface
  107.     {
  108.         return $this->heure_fin;
  109.     }
  110.     public function setHeureFin(?\DateTimeInterface $heure_fin): self
  111.     {
  112.         $this->heure_fin $heure_fin;
  113.         return $this;
  114.     }
  115.     public function getJours(): ?array
  116.     {
  117.         return $this->jours;
  118.     }
  119.     public function setJours(?array $jours): self
  120.     {
  121.         $this->jours $jours;
  122.         return $this;
  123.     }
  124.     public function getNbreParties(): ?int
  125.     {
  126.         return $this->nbre_parties;
  127.     }
  128.     public function setNbreParties(?int $nbre_parties): self
  129.     {
  130.         $this->nbre_parties $nbre_parties;
  131.         return $this;
  132.     }
  133.     public function getDateDebut(): ?\DateTimeInterface
  134.     {
  135.         return $this->date_debut;
  136.     }
  137.     public function setDateDebut(?\DateTimeInterface $date_debut): self
  138.     {
  139.         $this->date_debut $date_debut;
  140.         return $this;
  141.     }
  142.     public function getDateFin(): ?\DateTimeInterface
  143.     {
  144.         return $this->date_fin;
  145.     }
  146.     public function setDateFin(?\DateTimeInterface $date_fin): self
  147.     {
  148.         $this->date_fin $date_fin;
  149.         return $this;
  150.     }
  151.     public function getTypeReduction(): ?string
  152.     {
  153.         return $this->type_reduction;
  154.     }
  155.     public function setTypeReduction(string $type_reduction): self
  156.     {
  157.         $this->type_reduction $type_reduction;
  158.         return $this;
  159.     }
  160.     public function getPriceTtc(): ?float
  161.     {
  162.         return $this->price_ttc;
  163.     }
  164.     public function setPriceTtc(?float $price_ttc): self
  165.     {
  166.         $this->price_ttc $price_ttc;
  167.         return $this;
  168.     }
  169.     public function getPercent(): ?float
  170.     {
  171.         return $this->percent;
  172.     }
  173.     public function setPercent(?float $percent): self
  174.     {
  175.         $this->percent $percent;
  176.         return $this;
  177.     }
  178.     public function getPriority(): ?int
  179.     {
  180.         return $this->priority;
  181.     }
  182.     public function setPriority(?int $priority): self
  183.     {
  184.         $this->priority $priority;
  185.         return $this;
  186.     }
  187.     public function getReduction(): ?string
  188.     {
  189.         if($this->type_reduction == 'montant')
  190.             $this->reduction number_format($this->price_ttc2'.'' ') . ' €';
  191.         else
  192.             $this->reduction number_format($this->percent 1000'.'' ') . ' %';
  193.         
  194.         return $this->reduction;
  195.     }
  196.     public function getForfait(): ?Forfait
  197.     {
  198.         return $this->forfait;
  199.     }
  200.     public function setForfait(?Forfait $forfait): self
  201.     {
  202.         $this->forfait $forfait;
  203.         return $this;
  204.     }
  205.     
  206.     public function getGroupby(): ?GroupTarifs
  207.     {
  208.         return $this->groupby;
  209.     }
  210.     public function setGroupby(?GroupTarifs $groupby): self
  211.     {
  212.         $this->groupby $groupby;
  213.         return $this;
  214.     }
  215. }