<?phpnamespace App\Entity;use App\Repository\TagRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TagRepository::class) */class Tag { use \App\Traits\CommonTrt; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $slug; /** * @ORM\OneToMany(targetEntity=SectionTitle::class, mappedBy="tag") */ private $SectionTitle; /** * @ORM\ManyToMany(targetEntity=About::class, mappedBy="tag") */ private $abouts; /** * @ORM\ManyToMany(targetEntity=Documents::class, mappedBy="tag") */ private $documents; /** * @ORM\OneToMany(targetEntity=Services::class, mappedBy="tag") */ private $services; public function __construct() { $this->documents = new ArrayCollection(); $this->SectionTitle = new ArrayCollection(); $this->abouts = new ArrayCollection(); $this->services = 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; } /** * @return Collection|Documents[] */ public function getDocuments(): Collection { return $this->documents; } public function addDocument(Documents $document): self { if (!$this->documents->contains($document)) { $this->documents[] = $document; $document->addTag($this); } return $this; } public function removeDocument(Documents $document): self { if ($this->documents->removeElement($document)) { $document->removeTag($this); } return $this; } /** * @return Collection<int, SectionTitle> */ public function getSectionTitle(): Collection { return $this->SectionTitle; } /** * @return Collection<int, About> */ public function getAbouts(): Collection { return $this->abouts; } public function addAbout(About $about): self { if (!$this->abouts->contains($about)) { $this->abouts[] = $about; $about->addTag($this); } return $this; } public function removeAbout(About $about): self { if ($this->abouts->removeElement($about)) { $about->removeTag($this); } return $this; } /** * @return Collection<int, Services> */ public function getServices(): Collection { return $this->services; } public function addService(Services $service): self { if (!$this->services->contains($service)) { $this->services[] = $service; $service->setTag($this); } return $this; } public function removeService(Services $service): self { if ($this->services->removeElement($service)) { // set the owning side to null (unless already changed) if ($service->getTag() === $this) { $service->setTag(null); } } return $this; }}