src/Entity/Main/PromosPanier.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Main;
  3. use App\Repository\PromosPanierRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=PromosPanierRepository::class)
  7.  */
  8. class PromosPanier
  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="string", length=64, nullable=true)
  26.      */
  27.     private $code;
  28.     /**
  29.      * @ORM\Column(type="time", nullable=true)
  30.      */
  31.     private $heure_debut;
  32.     /**
  33.      * @ORM\Column(type="time", nullable=true)
  34.      */
  35.     private $heure_fin;
  36.     /**
  37.      * @ORM\Column(type="array", nullable=true)
  38.      */
  39.     private $jours = [];
  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="float", nullable=true)
  50.      */
  51.     private $montantMinimun;
  52.     /**
  53.      * @ORM\Column(type="string", length=64)
  54.      */
  55.     private $type_reduction;
  56.     /**
  57.      * @ORM\Column(type="float", nullable=true)
  58.      */
  59.     private $price_ttc;
  60.     /**
  61.      * @ORM\Column(type="float", nullable=true)
  62.      */
  63.     private $percent;
  64.     /**
  65.      * @ORM\Column(type="integer")
  66.      */
  67.     private $priority;
  68.     
  69.     private $reduction;
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getDesignation(): ?string
  75.     {
  76.         return $this->designation;
  77.     }
  78.     public function setDesignation(string $designation): self
  79.     {
  80.         $this->designation $designation;
  81.         return $this;
  82.     }
  83.     public function getInformation(): ?string
  84.     {
  85.         return $this->information;
  86.     }
  87.     public function setInformation(?string $information): self
  88.     {
  89.         $this->information $information;
  90.         return $this;
  91.     }
  92.     public function getCode(): ?string
  93.     {
  94.         return $this->code;
  95.     }
  96.     public function setCode(?string $code): self
  97.     {
  98.         $this->code $code;
  99.         return $this;
  100.     }
  101.     public function getHeureDebut(): ?\DateTimeInterface
  102.     {
  103.         return $this->heure_debut;
  104.     }
  105.     public function setHeureDebut(?\DateTimeInterface $heure_debut): self
  106.     {
  107.         $this->heure_debut $heure_debut;
  108.         return $this;
  109.     }
  110.     public function getHeureFin(): ?\DateTimeInterface
  111.     {
  112.         return $this->heure_fin;
  113.     }
  114.     public function setHeureFin(?\DateTimeInterface $heure_fin): self
  115.     {
  116.         $this->heure_fin $heure_fin;
  117.         return $this;
  118.     }
  119.     public function getJours(): ?array
  120.     {
  121.         return $this->jours;
  122.     }
  123.     public function setJours(?array $jours): self
  124.     {
  125.         $this->jours $jours;
  126.         return $this;
  127.     }
  128.     public function getDateDebut(): ?\DateTimeInterface
  129.     {
  130.         return $this->date_debut;
  131.     }
  132.     public function setDateDebut(?\DateTimeInterface $date_debut): self
  133.     {
  134.         $this->date_debut $date_debut;
  135.         return $this;
  136.     }
  137.     public function getDateFin(): ?\DateTimeInterface
  138.     {
  139.         return $this->date_fin;
  140.     }
  141.     public function setDateFin(?\DateTimeInterface $date_fin): self
  142.     {
  143.         $this->date_fin $date_fin;
  144.         return $this;
  145.     }
  146.     public function getMontantMinimun(): ?float
  147.     {
  148.         return $this->montantMinimun;
  149.     }
  150.     public function setMontantMinimun(?float $montantMinimun): self
  151.     {
  152.         $this->montantMinimun $montantMinimun;
  153.         return $this;
  154.     }
  155.     public function getTypeReduction(): ?string
  156.     {
  157.         return $this->type_reduction;
  158.     }
  159.     public function setTypeReduction(string $type_reduction): self
  160.     {
  161.         $this->type_reduction $type_reduction;
  162.         return $this;
  163.     }
  164.     public function getPriceTtc(): ?float
  165.     {
  166.         return $this->price_ttc;
  167.     }
  168.     public function setPriceTtc(?float $price_ttc): self
  169.     {
  170.         $this->price_ttc $price_ttc;
  171.         return $this;
  172.     }
  173.     public function getPercent(): ?float
  174.     {
  175.         return $this->percent;
  176.     }
  177.     public function setPercent(?float $percent): self
  178.     {
  179.         $this->percent $percent;
  180.         return $this;
  181.     }
  182.     public function getPriority(): ?int
  183.     {
  184.         return $this->priority;
  185.     }
  186.     public function setPriority(int $priority): self
  187.     {
  188.         $this->priority $priority;
  189.         return $this;
  190.     }
  191.     public function getReduction(): ?string
  192.     {
  193.         if($this->type_reduction == 'montant')
  194.             $this->reduction number_format($this->price_ttc2'.'' ') . ' €';
  195.         else
  196.             $this->reduction number_format($this->percent 1000'.'' ') . ' %';
  197.         
  198.         return $this->reduction;
  199.     }
  200. }