src/Entity/Purchaser.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PurchaserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PurchaserRepository::class)
  9.  */
  10. class Purchaser
  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, nullable=true)
  20.      */
  21.     private $nazwa;
  22.     /**
  23.      * @ORM\Column(type="string", length=15, nullable=true)
  24.      */
  25.     private $nip;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $adres;
  30.     /**
  31.      * @ORM\Column(type="string", length=30, nullable=true)
  32.      */
  33.     private $kod;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $miasto;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $mail;
  42.     /**
  43.      * @ORM\Column(type="string", length=50, nullable=true)
  44.      */
  45.     private $telefon;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=Partner::class, inversedBy="purchasers")
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $partner;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="purchasers")
  53.      */
  54.     private $user;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=Zamowienia::class, mappedBy="purchaser", orphanRemoval=true)
  57.      */
  58.     private $zamowienias;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $wojewodztwo;
  63.     public function __construct()
  64.     {
  65.         $this->zamowienias = new ArrayCollection();
  66.     }
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getNazwa(): ?string
  72.     {
  73.         return $this->nazwa;
  74.     }
  75.     public function setNazwa(?string $nazwa): self
  76.     {
  77.         $this->nazwa $nazwa;
  78.         return $this;
  79.     }
  80.     public function getNip(): ?string
  81.     {
  82.         return $this->nip;
  83.     }
  84.     public function setNip(?string $nip): self
  85.     {
  86.         $this->nip $nip;
  87.         return $this;
  88.     }
  89.     public function getAdres(): ?string
  90.     {
  91.         return $this->adres;
  92.     }
  93.     public function setAdres(?string $adres): self
  94.     {
  95.         $this->adres $adres;
  96.         return $this;
  97.     }
  98.     public function getKod(): ?string
  99.     {
  100.         return $this->kod;
  101.     }
  102.     public function setKod(?string $kod): self
  103.     {
  104.         $this->kod $kod;
  105.         return $this;
  106.     }
  107.     public function getMiasto(): ?string
  108.     {
  109.         return $this->miasto;
  110.     }
  111.     public function setMiasto(?string $miasto): self
  112.     {
  113.         $this->miasto $miasto;
  114.         return $this;
  115.     }
  116.     public function getMail(): ?string
  117.     {
  118.         return $this->mail;
  119.     }
  120.     public function setMail(?string $mail): self
  121.     {
  122.         $this->mail $mail;
  123.         return $this;
  124.     }
  125.     public function getTelefon(): ?string
  126.     {
  127.         return $this->telefon;
  128.     }
  129.     public function setTelefon(?string $telefon): self
  130.     {
  131.         $this->telefon $telefon;
  132.         return $this;
  133.     }
  134.     public function getPartner(): ?Partner
  135.     {
  136.         return $this->partner;
  137.     }
  138.     public function setPartner(?Partner $partner): self
  139.     {
  140.         $this->partner $partner;
  141.         return $this;
  142.     }
  143.     public function getUser(): ?User
  144.     {
  145.         return $this->user;
  146.     }
  147.     public function setUser(?User $user): self
  148.     {
  149.         $this->user $user;
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return Collection<int, Zamowienia>
  154.      */
  155.     public function getZamowienias(): Collection
  156.     {
  157.         return $this->zamowienias;
  158.     }
  159.     public function addZamowienia(Zamowienia $zamowienia): self
  160.     {
  161.         if (!$this->zamowienias->contains($zamowienia)) {
  162.             $this->zamowienias[] = $zamowienia;
  163.             $zamowienia->setPurchaser($this);
  164.         }
  165.         return $this;
  166.     }
  167.     public function removeZamowienia(Zamowienia $zamowienia): self
  168.     {
  169.         if ($this->zamowienias->removeElement($zamowienia)) {
  170.             // set the owning side to null (unless already changed)
  171.             if ($zamowienia->getPurchaser() === $this) {
  172.                 $zamowienia->setPurchaser(null);
  173.             }
  174.         }
  175.         return $this;
  176.     }
  177.     public function getWojewodztwo(): ?string
  178.     {
  179.         return $this->wojewodztwo;
  180.     }
  181.     public function setWojewodztwo(?string $wojewodztwo): self
  182.     {
  183.         $this->wojewodztwo $wojewodztwo;
  184.         return $this;
  185.     }
  186. }