src/Entity/Laboratoire.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LaboratoireRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LaboratoireRepository::class)
  9.  */
  10. class Laboratoire
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $designation;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $adresse;
  26.     /**
  27.      * @ORM\Column(type="string", length=50, nullable=true)
  28.      */
  29.     private $phone;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $email;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="laboratoire")
  36.      */
  37.     private $products;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Slider::class, mappedBy="laboratoire")
  40.      */
  41.     private $sliders;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $photo;
  46.     public function __construct()
  47.     {
  48.         $this->products = new ArrayCollection();
  49.         $this->sliders = new ArrayCollection();
  50.     }
  51.     public function __toString(){
  52.         return $this->getDesignation();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getDesignation(): ?string
  59.     {
  60.         return $this->designation;
  61.     }
  62.     public function setDesignation(string $designation): self
  63.     {
  64.         $this->designation $designation;
  65.         return $this;
  66.     }
  67.     public function getAdresse(): ?string
  68.     {
  69.         return $this->adresse;
  70.     }
  71.     public function setAdresse(string $adresse): self
  72.     {
  73.         $this->adresse $adresse;
  74.         return $this;
  75.     }
  76.     public function getPhone(): ?string
  77.     {
  78.         return $this->phone;
  79.     }
  80.     public function setPhone(?string $phone): self
  81.     {
  82.         $this->phone $phone;
  83.         return $this;
  84.     }
  85.     public function getEmail(): ?string
  86.     {
  87.         return $this->email;
  88.     }
  89.     public function setEmail(string $email): self
  90.     {
  91.         $this->email $email;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, Product>
  96.      */
  97.     public function getProducts(): Collection
  98.     {
  99.         return $this->products;
  100.     }
  101.     public function addProduct(Product $product): self
  102.     {
  103.         if (!$this->products->contains($product)) {
  104.             $this->products[] = $product;
  105.             $product->setLaboratoire($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeProduct(Product $product): self
  110.     {
  111.         if ($this->products->removeElement($product)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($product->getLaboratoire() === $this) {
  114.                 $product->setLaboratoire(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, Slider>
  121.      */
  122.     public function getSliders(): Collection
  123.     {
  124.         return $this->sliders;
  125.     }
  126.     public function addSlider(Slider $slider): self
  127.     {
  128.         if (!$this->sliders->contains($slider)) {
  129.             $this->sliders[] = $slider;
  130.             $slider->setLaboratoire($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeSlider(Slider $slider): self
  135.     {
  136.         if ($this->sliders->removeElement($slider)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($slider->getLaboratoire() === $this) {
  139.                 $slider->setLaboratoire(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     public function getPhoto(): ?string
  145.     {
  146.         return $this->photo;
  147.     }
  148.     public function setPhoto(?string $photo): self
  149.     {
  150.         $this->photo $photo;
  151.         return $this;
  152.     }
  153. }