<?phpnamespace App\Entity;use App\Repository\StakeholderTagRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;#[ORM\Entity(repositoryClass: StakeholderTagRepository::class)]#[ORM\Table(name: 'stakeholder_tag')]#[ORM\UniqueConstraint( name: 'unique_slug_firm', columns: ["slug", "accounting_firm_id"])]class StakeholderTag{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $name; #[Gedmo\Slug(fields: ['name'], updatable: true)] #[ORM\Column(type: 'string', length: 255)] private $slug; #[ORM\ManyToOne(targetEntity: AccountingFirm::class, inversedBy: 'stakeholderTags')] #[ORM\JoinColumn(nullable: false)] private $accountingFirm; #[ORM\ManyToMany(targetEntity: Stakeholder::class, mappedBy: 'stakeholderTags')] private $stakeholders; public function __construct() { $this->stakeholders = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getAccountingFirm(): ?AccountingFirm { return $this->accountingFirm; } public function setAccountingFirm(?AccountingFirm $accountingFirm): self { $this->accountingFirm = $accountingFirm; return $this; } /** * @return Collection<int, Stakeholder> */ public function getStakeholders(): Collection { return $this->stakeholders; } public function addStakeholder(Stakeholder $stakeholder): self { if (!$this->stakeholders->contains($stakeholder)) { $this->stakeholders[] = $stakeholder; $stakeholder->addStakeholderTag($this); } return $this; } public function removeStakeholder(Stakeholder $stakeholder): self { if ($this->stakeholders->removeElement($stakeholder)) { $stakeholder->removeStakeholderTag($this); } return $this; }}