<?php
namespace App\Entity\Main;
use App\Repository\PromosPanierRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PromosPanierRepository::class)
*/
class PromosPanier
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=128)
*/
private $designation;
/**
* @ORM\Column(type="string", length=128, nullable=true)
*/
private $information;
/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
private $code;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $heure_debut;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $heure_fin;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $jours = [];
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date_debut;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date_fin;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $montantMinimun;
/**
* @ORM\Column(type="string", length=64)
*/
private $type_reduction;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $price_ttc;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $percent;
/**
* @ORM\Column(type="integer")
*/
private $priority;
private $reduction;
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(string $designation): self
{
$this->designation = $designation;
return $this;
}
public function getInformation(): ?string
{
return $this->information;
}
public function setInformation(?string $information): self
{
$this->information = $information;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
public function getHeureDebut(): ?\DateTimeInterface
{
return $this->heure_debut;
}
public function setHeureDebut(?\DateTimeInterface $heure_debut): self
{
$this->heure_debut = $heure_debut;
return $this;
}
public function getHeureFin(): ?\DateTimeInterface
{
return $this->heure_fin;
}
public function setHeureFin(?\DateTimeInterface $heure_fin): self
{
$this->heure_fin = $heure_fin;
return $this;
}
public function getJours(): ?array
{
return $this->jours;
}
public function setJours(?array $jours): self
{
$this->jours = $jours;
return $this;
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->date_debut;
}
public function setDateDebut(?\DateTimeInterface $date_debut): self
{
$this->date_debut = $date_debut;
return $this;
}
public function getDateFin(): ?\DateTimeInterface
{
return $this->date_fin;
}
public function setDateFin(?\DateTimeInterface $date_fin): self
{
$this->date_fin = $date_fin;
return $this;
}
public function getMontantMinimun(): ?float
{
return $this->montantMinimun;
}
public function setMontantMinimun(?float $montantMinimun): self
{
$this->montantMinimun = $montantMinimun;
return $this;
}
public function getTypeReduction(): ?string
{
return $this->type_reduction;
}
public function setTypeReduction(string $type_reduction): self
{
$this->type_reduction = $type_reduction;
return $this;
}
public function getPriceTtc(): ?float
{
return $this->price_ttc;
}
public function setPriceTtc(?float $price_ttc): self
{
$this->price_ttc = $price_ttc;
return $this;
}
public function getPercent(): ?float
{
return $this->percent;
}
public function setPercent(?float $percent): self
{
$this->percent = $percent;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getReduction(): ?string
{
if($this->type_reduction == 'montant')
$this->reduction = number_format($this->price_ttc, 2, '.', ' ') . ' €';
else
$this->reduction = number_format($this->percent * 100, 0, '.', ' ') . ' %';
return $this->reduction;
}
}