src/Entity/ProduitPromotionHistory.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Produit;
  5. use App\Entity\Promotion;
  6. /**
  7.  * Historique des promotions appliquées à un produit.
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\ProduitPromotionHistoryRepository")
  10.  * @ORM\Table(name="produit_promotion_history", indexes={
  11.  *   @ORM\Index(columns={"started_at"}),
  12.  *   @ORM\Index(columns={"ended_at"})
  13.  * })
  14.  */
  15. class ProduitPromotionHistory
  16. {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private int $id;
  23.     /**
  24.      * Produit concerné.
  25.      * @ORM\ManyToOne(targetEntity=Produit::class)
  26.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  27.      */
  28.     private Produit $product;
  29.     /**
  30.      * Promotion appliquée.
  31.      * @ORM\ManyToOne(targetEntity=Promotion::class)
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private Promotion $promotion;
  35.     /**
  36.      * Date/heure d’application.
  37.      * @ORM\Column(type="datetime_immutable")
  38.      */
  39.     private \DateTimeImmutable $startedAt;
  40.     /**
  41.      * Date/heure de fin (null si en cours).
  42.      * @ORM\Column(type="datetime_immutable", nullable=true)
  43.      */
  44.     private ?\DateTimeImmutable $endedAt null;
  45.     /**
  46.      * Opérateur ayant appliqué la promo (identifiant lisible).
  47.      * @ORM\Column(type="string", length=100, nullable=true)
  48.      */
  49.     private ?string $startedBy null;
  50.     /**
  51.      * Opérateur ayant mis fin à la promo.
  52.      * @ORM\Column(type="string", length=100, nullable=true)
  53.      */
  54.     private ?string $endedBy null;
  55.     /**
  56.      * Motif de fin.
  57.      * @ORM\Column(type="string", length=120, nullable=true)
  58.      */
  59.     private ?string $endReason null;
  60.     /** @ORM\Column(type="text", nullable=true) */
  61.     private ?string $endNote null;
  62.     
  63.     public function getId(): int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getProduct(): Produit
  68.     {
  69.         return $this->product;
  70.     }
  71.     public function setProduct(Produit $product): self
  72.     {
  73.         $this->product $product;
  74.         return $this;
  75.     }
  76.     public function getPromotion(): Promotion
  77.     {
  78.         return $this->promotion;
  79.     }
  80.     public function setPromotion(Promotion $promotion): self
  81.     {
  82.         $this->promotion $promotion;
  83.         return $this;
  84.     }
  85.     public function getStartedAt(): \DateTimeImmutable
  86.     {
  87.         return $this->startedAt;
  88.     }
  89.     public function setStartedAt(\DateTimeImmutable $startedAt): self
  90.     {
  91.         $this->startedAt $startedAt;
  92.         return $this;
  93.     }
  94.     public function getEndedAt(): ?\DateTimeImmutable
  95.     {
  96.         return $this->endedAt;
  97.     }
  98.     public function setEndedAt(?\DateTimeImmutable $endedAt): self
  99.     {
  100.         $this->endedAt $endedAt;
  101.         return $this;
  102.     }
  103.     public function getStartedBy(): ?string
  104.     {
  105.         return $this->startedBy;
  106.     }
  107.     public function setStartedBy(?string $startedBy): self
  108.     {
  109.         $this->startedBy $startedBy;
  110.         return $this;
  111.     }
  112.     public function getEndedBy(): ?string
  113.     {
  114.         return $this->endedBy;
  115.     }
  116.     public function setEndedBy(?string $endedBy): self
  117.     {
  118.         $this->endedBy $endedBy;
  119.         return $this;
  120.     }
  121.     public function getEndReason(): ?string
  122.     {
  123.         return $this->endReason;
  124.     }
  125.     public function setEndReason(?string $endReason): self
  126.     {
  127.         $this->endReason $endReason;
  128.         return $this;
  129.     }
  130.     public function getEndNote(): ?string { return $this->endNote; }
  131.     public function setEndNote(?string $endNote): self $this->endNote $endNote; return $this; }
  132. }