src/Entity/LogPromotions.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\LogPromotionsRepository")
  8.  */
  9. class LogPromotions
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\Commande", inversedBy="logPromotions")
  19.      */
  20.     private $idCommande;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="logPromotions")
  23.      */
  24.     private $idClient;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Promotions", inversedBy="logPromotions")
  27.      */
  28.     private $idPromotion;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\Commande", mappedBy="logPromo")
  31.      */
  32.     private $commandes;
  33.     /**
  34.      * @ORM\Column(type="datetime", nullable=true)
  35.      */
  36.     private $dateCreation;
  37.     public function __construct()
  38.     {
  39.         $this->commandes = new ArrayCollection();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getIdCommande(): ?Commande
  46.     {
  47.         return $this->idCommande;
  48.     }
  49.     public function setIdCommande(?Commande $idCommande): self
  50.     {
  51.         $this->idCommande $idCommande;
  52.         return $this;
  53.     }
  54.     public function getIdClient(): ?User
  55.     {
  56.         return $this->idClient;
  57.     }
  58.     public function setIdClient(?User $idClient): self
  59.     {
  60.         $this->idClient $idClient;
  61.         return $this;
  62.     }
  63.     public function getIdPromotion(): ?Promotions
  64.     {
  65.         return $this->idPromotion;
  66.     }
  67.     public function setIdPromotion(?Promotions $idPromotion): self
  68.     {
  69.         $this->idPromotion $idPromotion;
  70.         return $this;
  71.     }
  72.     /**
  73.      * @return Collection|Commande[]
  74.      */
  75.     public function getCommandes(): Collection
  76.     {
  77.         return $this->commandes;
  78.     }
  79.     public function addCommande(Commande $commande): self
  80.     {
  81.         if (!$this->commandes->contains($commande)) {
  82.             $this->commandes[] = $commande;
  83.             $commande->setLogPromo($this);
  84.         }
  85.         return $this;
  86.     }
  87.     public function removeCommande(Commande $commande): self
  88.     {
  89.         if ($this->commandes->contains($commande)) {
  90.             $this->commandes->removeElement($commande);
  91.             // set the owning side to null (unless already changed)
  92.             if ($commande->getLogPromo() === $this) {
  93.                 $commande->setLogPromo(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     public function getDateCreation(): ?\DateTimeInterface
  99.     {
  100.         return $this->dateCreation;
  101.     }
  102.     public function setDateCreation(?\DateTimeInterface $dateCreation): self
  103.     {
  104.         $this->dateCreation $dateCreation;
  105.         return $this;
  106.     }
  107. }