src/Entity/ThirdPartyCategory.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\ThirdPartyCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ThirdPartyCategoryRepository::class)]#[ApiResource]class ThirdPartyCategory{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $categoryLabel = null;#[ORM\OneToMany(mappedBy: 'thirdPartyCategory', targetEntity: ThirdParty::class, orphanRemoval: true)]private Collection $thirdParties;public function __construct(){$this->thirdParties = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCategoryLabel(): ?string{return $this->categoryLabel;}public function setCategoryLabel(string $categoryLabel): self{$this->categoryLabel = $categoryLabel;return $this;}/*** @return Collection<int, ThirdParty>*/public function getThirdParties(): Collection{return $this->thirdParties;}public function addThirdParty(ThirdParty $thirdParty): self{if (!$this->thirdParties->contains($thirdParty)) {$this->thirdParties->add($thirdParty);$thirdParty->setThirdPartyCategory($this);}return $this;}public function removeThirdParty(ThirdParty $thirdParty): self{if ($this->thirdParties->removeElement($thirdParty)) {// set the owning side to null (unless already changed)if ($thirdParty->getThirdPartyCategory() === $this) {$thirdParty->setThirdPartyCategory(null);}}return $this;}}