<?php
namespace App\Entity;
use App\Repository\PurchaserRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PurchaserRepository::class)
*/
class Purchaser
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nazwa;
/**
* @ORM\Column(type="string", length=15, nullable=true)
*/
private $nip;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adres;
/**
* @ORM\Column(type="string", length=30, nullable=true)
*/
private $kod;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $miasto;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mail;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $telefon;
/**
* @ORM\ManyToOne(targetEntity=Partner::class, inversedBy="purchasers")
* @ORM\JoinColumn(nullable=false)
*/
private $partner;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="purchasers")
*/
private $user;
/**
* @ORM\OneToMany(targetEntity=Zamowienia::class, mappedBy="purchaser", orphanRemoval=true)
*/
private $zamowienias;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $wojewodztwo;
public function __construct()
{
$this->zamowienias = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNazwa(): ?string
{
return $this->nazwa;
}
public function setNazwa(?string $nazwa): self
{
$this->nazwa = $nazwa;
return $this;
}
public function getNip(): ?string
{
return $this->nip;
}
public function setNip(?string $nip): self
{
$this->nip = $nip;
return $this;
}
public function getAdres(): ?string
{
return $this->adres;
}
public function setAdres(?string $adres): self
{
$this->adres = $adres;
return $this;
}
public function getKod(): ?string
{
return $this->kod;
}
public function setKod(?string $kod): self
{
$this->kod = $kod;
return $this;
}
public function getMiasto(): ?string
{
return $this->miasto;
}
public function setMiasto(?string $miasto): self
{
$this->miasto = $miasto;
return $this;
}
public function getMail(): ?string
{
return $this->mail;
}
public function setMail(?string $mail): self
{
$this->mail = $mail;
return $this;
}
public function getTelefon(): ?string
{
return $this->telefon;
}
public function setTelefon(?string $telefon): self
{
$this->telefon = $telefon;
return $this;
}
public function getPartner(): ?Partner
{
return $this->partner;
}
public function setPartner(?Partner $partner): self
{
$this->partner = $partner;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
/**
* @return Collection<int, Zamowienia>
*/
public function getZamowienias(): Collection
{
return $this->zamowienias;
}
public function addZamowienia(Zamowienia $zamowienia): self
{
if (!$this->zamowienias->contains($zamowienia)) {
$this->zamowienias[] = $zamowienia;
$zamowienia->setPurchaser($this);
}
return $this;
}
public function removeZamowienia(Zamowienia $zamowienia): self
{
if ($this->zamowienias->removeElement($zamowienia)) {
// set the owning side to null (unless already changed)
if ($zamowienia->getPurchaser() === $this) {
$zamowienia->setPurchaser(null);
}
}
return $this;
}
public function getWojewodztwo(): ?string
{
return $this->wojewodztwo;
}
public function setWojewodztwo(?string $wojewodztwo): self
{
$this->wojewodztwo = $wojewodztwo;
return $this;
}
}