<?phpnamespace App\Entity;use App\Repository\ProveedorRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Serializable;/** * @ORM\Entity(repositoryClass=ProveedorRepository::class) */class Proveedor{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nombre; /** * @ORM\OneToMany(targetEntity=ProductoProveedor::class, mappedBy="proveedor") */ private $productoProveedors; /** * @ORM\OneToMany(targetEntity=Contrato::class, mappedBy="proveedor") */ private $contratos; /** * @ORM\ManyToMany(targetEntity=Canal::class, inversedBy="proveedores") */ private $canales; public function __construct() { $this->productoProveedors = new ArrayCollection(); $this->canales = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(string $nombre): self { $this->nombre = $nombre; return $this; } /** * @return Collection|ProductoProveedor[] */ public function getProductoProveedors(): Collection { return $this->productoProveedors; } public function addProductoProveedor(ProductoProveedor $productoProveedor): self { if (!$this->productoProveedors->contains($productoProveedor)) { $this->productoProveedors[] = $productoProveedor; $productoProveedor->setProveedor($this); } return $this; } public function removeProductoProveedor(ProductoProveedor $productoProveedor): self { if ($this->productoProveedors->contains($productoProveedor)) { $this->productoProveedors->removeElement($productoProveedor); // set the owning side to null (unless already changed) if ($productoProveedor->getProveedor() === $this) { $productoProveedor->setProveedor(null); } } return $this; } /** * @return Collection|Contrato[] */ public function getContratos(): Collection { return $this->contratos; } public function addContrato(Contrato $contrato): self { if (!$this->contratos->contains($contrato)) { $this->contratos[] = $contrato; $contrato->setProveedor($this); } return $this; } public function removeContrato(Contrato $contrato): self { if ($this->contratos->contains($contrato)) { $this->contratos->removeElement($contrato); // set the owning side to null (unless already changed) if ($contrato->getProveedor() === $this) { $contrato->setProveedor(null); } } return $this; } /** * @return Collection|Canal[] */ public function getCanales(): Collection { return $this->canales; } public function addCanal(Canal $canal): self { if (!$this->canales->contains($canal)) { $this->canales[] = $canal; $canal->addProveedore($this); } return $this; } public function removeCanal(Canal $canal): self { if ($this->canales->contains($canal)) { $this->canales->removeElement($canal); $canal->removeProveedore($this); } return $this; } public function __toString():?string { return $this->nombre; }}