<?phpnamespace App\Entity;use App\Repository\SectionTitleRepository;use App\Traits\CommonTrt;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SectionTitleRepository::class) */class SectionTitle{ use CommonTrt; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\Column(type="text", nullable=true) */ private $subtitle; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $image; /** * @ORM\Column(type="boolean") */ private $isActive; /** * @ORM\ManyToMany(targetEntity=Tag::class, inversedBy="sectionTitles") */ private $tag; public function __construct() { $this->tag = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getSubtitle(): ?string { return $this->subtitle; } public function setSubtitle(?string $subtitle): self { $this->subtitle = $subtitle; return $this; } public function getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } public function isIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } /** * @return Collection<int, Tag> */ public function getTag(): Collection { return $this->tag; } public function addTag(Tag $tag): self { if (!$this->tag->contains($tag)) { $this->tag[] = $tag; } return $this; } public function removeTag(Tag $tag): self { $this->tag->removeElement($tag); return $this; }}