src/Entity/Panier.php line 13

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\Table(name="panier")
  8.  * @ORM\Entity(repositoryClass="App\Repository\PanierRepository")
  9.  */
  10. class Panier
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\Ref", inversedBy="paniers")
  20.      */
  21.     private $statut;
  22.     /**
  23.      * @ORM\Column(name="dateCreation",type="date", nullable=true)
  24.      */
  25.     private $dateCreation;
  26.     /**
  27.      * @ORM\Column(name="prixTotal",type="float", nullable=true)
  28.      */
  29.     private $prixTotal;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="paniers")
  32.      * @ORM\JoinColumns({
  33.      *  @ORM\JoinColumn(name="creerPar_id", referencedColumnName="id")
  34.      * })
  35.      */
  36.     private $creerPar;
  37.     /**
  38.      * @ORM\Column(name="numPanier", type="string", length=255, nullable=true)
  39.      */
  40.     private $numPanier;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\Commande", mappedBy="idPanier")
  43.      */
  44.     private $commandes;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\Sejour", inversedBy="paniers")
  47.       * @ORM\JoinColumns({
  48.      *  @ORM\JoinColumn(name="idSejour_id", referencedColumnName="id")
  49.      * })
  50.      */
  51.     private $idSejour;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity="App\Entity\PanierProduit", mappedBy="idPanier")
  54.      */
  55.     private $panierProduits;
  56.     /**
  57.      * @ORM\Column(name="Jeton",type="integer", nullable=true)
  58.      */
  59.     private $jeton;
  60.     /**
  61.      * @return mixed
  62.      */
  63.     public function getJeton()
  64.     {
  65.         return $this->jeton;
  66.     }
  67.     /**
  68.      * @param mixed $jeton
  69.      */
  70.     public function setJeton($jeton): void
  71.     {
  72.         $this->jeton $jeton;
  73.     }
  74.     public function __construct()
  75.     {
  76.         $this->commandes = new ArrayCollection();
  77.         $this->panierProduits = new ArrayCollection();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getStatut(): ?Ref
  84.     {
  85.         return $this->statut;
  86.     }
  87.     public function setStatut(?Ref $statut): self
  88.     {
  89.         $this->statut $statut;
  90.         return $this;
  91.     }
  92.     public function getDateCreation(): ?\DateTimeInterface
  93.     {
  94.         return $this->dateCreation;
  95.     }
  96.     public function setDateCreation(?\DateTimeInterface $dateCreation): self
  97.     {
  98.         $this->dateCreation $dateCreation;
  99.         return $this;
  100.     }
  101.     public function getPrixTotal(): ?float
  102.     {
  103.         return $this->prixTotal;
  104.     }
  105.     public function setPrixTotal(?float $prixTotal): self
  106.     {
  107.         $this->prixTotal $prixTotal;
  108.         return $this;
  109.     }
  110.     public function getCreerPar(): ?User
  111.     {
  112.         return $this->creerPar;
  113.     }
  114.     public function setCreerPar(?User $creerPar): self
  115.     {
  116.         $this->creerPar $creerPar;
  117.         return $this;
  118.     }
  119.     public function getNumPanier(): ?string
  120.     {
  121.         return $this->numPanier;
  122.     }
  123.     public function setNumPanier(?string $numPanier): self
  124.     {
  125.         $this->numPanier $numPanier;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection|Commande[]
  130.      */
  131.     public function getCommandes(): Collection
  132.     {
  133.         return $this->commandes;
  134.     }
  135.     public function addCommande(Commande $commande): self
  136.     {
  137.         if (!$this->commandes->contains($commande)) {
  138.             $this->commandes[] = $commande;
  139.             $commande->setIdPanier($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeCommande(Commande $commande): self
  144.     {
  145.         if ($this->commandes->contains($commande)) {
  146.             $this->commandes->removeElement($commande);
  147.             // set the owning side to null (unless already changed)
  148.             if ($commande->getIdPanier() === $this) {
  149.                 $commande->setIdPanier(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function getIdSejour(): ?Sejour
  155.     {
  156.         return $this->idSejour;
  157.     }
  158.     public function setIdSejour(?Sejour $idSejour): self
  159.     {
  160.         $this->idSejour $idSejour;
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection|PanierProduit[]
  165.      */
  166.     public function getPanierProduits(): Collection
  167.     {
  168.         return $this->panierProduits;
  169.     }
  170.     public function addPanierProduit(PanierProduit $panierProduit): self
  171.     {
  172.         if (!$this->panierProduits->contains($panierProduit)) {
  173.             $this->panierProduits[] = $panierProduit;
  174.             $panierProduit->setIdPanier($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removePanierProduit(PanierProduit $panierProduit): self
  179.     {
  180.         if ($this->panierProduits->contains($panierProduit)) {
  181.             $this->panierProduits->removeElement($panierProduit);
  182.             // set the owning side to null (unless already changed)
  183.             if ($panierProduit->getIdPanier() === $this) {
  184.                 $panierProduit->setIdPanier(null);
  185.             }
  186.         }
  187.         return $this;
  188.     }
  189. }