<?php
namespace App\Entity;
use App\Repository\PartnerKategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PartnerKategoryRepository::class)
*/
class PartnerKategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nazwa;
/**
* @ORM\Column(type="string", length=10)
*/
private $short;
/**
* @ORM\OneToMany(targetEntity=Partner::class, mappedBy="partnerKategory", orphanRemoval=true)
*/
private $partners;
public function __construct()
{
$this->partners = 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 getShort(): ?string
{
return $this->short;
}
public function setShort(string $short): self
{
$this->short = $short;
return $this;
}
/**
* @return Collection<int, Partner>
*/
public function getPartners(): Collection
{
return $this->partners;
}
public function addPartner(Partner $partner): self
{
if (!$this->partners->contains($partner)) {
$this->partners[] = $partner;
$partner->setPartnerKategory($this);
}
return $this;
}
public function removePartner(Partner $partner): self
{
if ($this->partners->removeElement($partner)) {
// set the owning side to null (unless already changed)
if ($partner->getPartnerKategory() === $this) {
$partner->setPartnerKategory(null);
}
}
return $this;
}
}