<?php
namespace App\Entity;
use App\Repository\LaboratoireRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LaboratoireRepository::class)
*/
class Laboratoire
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $designation;
/**
* @ORM\Column(type="string", length=255)
*/
private $adresse;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\OneToMany(targetEntity=Product::class, mappedBy="laboratoire")
*/
private $products;
/**
* @ORM\OneToMany(targetEntity=Slider::class, mappedBy="laboratoire")
*/
private $sliders;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $photo;
public function __construct()
{
$this->products = new ArrayCollection();
$this->sliders = new ArrayCollection();
}
public function __toString(){
return $this->getDesignation();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(string $designation): self
{
$this->designation = $designation;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setLaboratoire($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getLaboratoire() === $this) {
$product->setLaboratoire(null);
}
}
return $this;
}
/**
* @return Collection<int, Slider>
*/
public function getSliders(): Collection
{
return $this->sliders;
}
public function addSlider(Slider $slider): self
{
if (!$this->sliders->contains($slider)) {
$this->sliders[] = $slider;
$slider->setLaboratoire($this);
}
return $this;
}
public function removeSlider(Slider $slider): self
{
if ($this->sliders->removeElement($slider)) {
// set the owning side to null (unless already changed)
if ($slider->getLaboratoire() === $this) {
$slider->setLaboratoire(null);
}
}
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
}