<?php
namespace App\Entity;
use App\Repository\LeverancierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LeverancierRepository::class)]
class Leverancier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $naam = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $wadres = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $wpostcode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $wwoonplaats = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $telefoon = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $padres = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $ppostcode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $pwoonplaats = null;
#[ORM\OneToMany(mappedBy: 'leverancier', targetEntity: Bestelling::class)]
private Collection $bestellings;
public function __construct()
{
$this->bestellings = new ArrayCollection();
}
public function __toString(): string
{
return $this->naam;
}
public function getId(): ?int
{
return $this->id;
}
public function getNaam(): ?string
{
return $this->naam;
}
public function setNaam(string $naam): static
{
$this->naam = $naam;
return $this;
}
public function getWadres(): ?string
{
return $this->wadres;
}
public function setWadres(?string $wadres): static
{
$this->wadres = $wadres;
return $this;
}
public function getWpostcode(): ?string
{
return $this->wpostcode;
}
public function setWpostcode(?string $wpostcode): static
{
$this->wpostcode = $wpostcode;
return $this;
}
public function getWwoonplaats(): ?string
{
return $this->wwoonplaats;
}
public function setWwoonplaats(?string $wwoonplaats): static
{
$this->wwoonplaats = $wwoonplaats;
return $this;
}
public function getTelefoon(): ?string
{
return $this->telefoon;
}
public function setTelefoon(?string $telefoon): static
{
$this->telefoon = $telefoon;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getPadres(): ?string
{
return $this->padres;
}
public function setPadres(?string $padres): static
{
$this->padres = $padres;
return $this;
}
public function getPpostcode(): ?string
{
return $this->ppostcode;
}
public function setPpostcode(?string $ppostcode): static
{
$this->ppostcode = $ppostcode;
return $this;
}
public function getPwoonplaats(): ?string
{
return $this->pwoonplaats;
}
public function setPwoonplaats(?string $pwoonplaats): static
{
$this->pwoonplaats = $pwoonplaats;
return $this;
}
/**
* @return Collection<int, Bestelling>
*/
public function getBestellings(): Collection
{
return $this->bestellings;
}
public function addBestelling(Bestelling $bestelling): static
{
if (!$this->bestellings->contains($bestelling)) {
$this->bestellings->add($bestelling);
$bestelling->setLeverancier($this);
}
return $this;
}
public function removeBestelling(Bestelling $bestelling): static
{
if ($this->bestellings->removeElement($bestelling)) {
// set the owning side to null (unless already changed)
if ($bestelling->getLeverancier() === $this) {
$bestelling->setLeverancier(null);
}
}
return $this;
}
}