src/Entity/TypeLocalisation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TypeLocalisationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TypeLocalisationRepository::class)
  9.  */
  10. class TypeLocalisation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=100, nullable=true)
  20.      */
  21.     private $labels;
  22.     /**
  23.      * @ORM\Column(type="string", length=100, nullable=true)
  24.      */
  25.     private $slugTypeLocal;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=Product::class, inversedBy="typeLocalisations")
  28.      */
  29.     private $product;
  30.     public function __construct()
  31.     {
  32.         $this->product = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getLabels(): ?string
  39.     {
  40.         return $this->labels;
  41.     }
  42.     public function setLabels(?string $labels): self
  43.     {
  44.         $this->labels $labels;
  45.         return $this;
  46.     }
  47.     public function getSlugTypeLocal(): ?string
  48.     {
  49.         return $this->slugTypeLocal;
  50.     }
  51.     public function setSlugTypeLocal(?string $slugTypeLocal): self
  52.     {
  53.         $this->slugTypeLocal $slugTypeLocal;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection|Product[]
  58.      */
  59.     public function getProduct(): Collection
  60.     {
  61.         return $this->product;
  62.     }
  63.     public function addProduct(Product $product): self
  64.     {
  65.         if (!$this->product->contains($product)) {
  66.             $this->product[] = $product;
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeProduct(Product $product): self
  71.     {
  72.         $this->product->removeElement($product);
  73.         return $this;
  74.     }
  75.     
  76. }