src/Entity/Ref.php line 15

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.  * Ref
  8.  *
  9.  * @ORM\Table(name="ref", indexes={@ORM\Index(name="fk_reftype_idx", columns={"typeref"})})
  10.  * @ORM\Entity
  11.  */
  12. class Ref
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string|null
  24.      *
  25.      * @ORM\Column(name="libiller", type="string", length=45, nullable=true)
  26.      */
  27.     private $libiller;
  28.     /**
  29.      * @var string|null
  30.      *
  31.      * @ORM\Column(name="code", type="string", length=45, nullable=true)
  32.      */
  33.     private $code;
  34.     /**
  35.      * @var \Typeref
  36.      *
  37.      * @ORM\ManyToOne(targetEntity="Typeref")
  38.      * @ORM\JoinColumns({
  39.      *   @ORM\JoinColumn(name="typeref", referencedColumnName="id")
  40.      * })
  41.      */
  42.     private $typeref;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="App\Entity\Panier", mappedBy="statut")
  45.      */
  46.     private $paniers;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\Promotions", mappedBy="statut")
  49.      */
  50.     private $promotions;
  51.     public function __construct()
  52.     {
  53.         $this->paniers = new ArrayCollection();
  54.         $this->promotions = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getLibiller(): ?string
  61.     {
  62.         return $this->libiller;
  63.     }
  64.     public function setLibiller(?string $libiller): self
  65.     {
  66.         $this->libiller $libiller;
  67.         return $this;
  68.     }
  69.     public function getCode(): ?string
  70.     {
  71.         return $this->code;
  72.     }
  73.     public function setCode(?string $code): self
  74.     {
  75.         $this->code $code;
  76.         return $this;
  77.     }
  78.     public function getTyperef(): ?Typeref
  79.     {
  80.         return $this->typeref;
  81.     }
  82.     public function setTyperef(?Typeref $typeref): self
  83.     {
  84.         $this->typeref $typeref;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection|Panier[]
  89.      */
  90.     public function getPaniers(): Collection
  91.     {
  92.         return $this->paniers;
  93.     }
  94.     public function addPanier(Panier $panier): self
  95.     {
  96.         if (!$this->paniers->contains($panier)) {
  97.             $this->paniers[] = $panier;
  98.             $panier->setStatut($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removePanier(Panier $panier): self
  103.     {
  104.         if ($this->paniers->contains($panier)) {
  105.             $this->paniers->removeElement($panier);
  106.             // set the owning side to null (unless already changed)
  107.             if ($panier->getStatut() === $this) {
  108.                 $panier->setStatut(null);
  109.             }
  110.         }
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Collection|Promotions[]
  115.      */
  116.     public function getPromotions(): Collection
  117.     {
  118.         return $this->promotions;
  119.     }
  120.     public function addPromotion(Promotions $promotion): self
  121.     {
  122.         if (!$this->promotions->contains($promotion)) {
  123.             $this->promotions[] = $promotion;
  124.             $promotion->setStatut($this);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removePromotion(Promotions $promotion): self
  129.     {
  130.         if ($this->promotions->contains($promotion)) {
  131.             $this->promotions->removeElement($promotion);
  132.             // set the owning side to null (unless already changed)
  133.             if ($promotion->getStatut() === $this) {
  134.                 $promotion->setStatut(null);
  135.             }
  136.         }
  137.         return $this;
  138.     }
  139. }