<?phpnamespace App\Entity\Blog;use App\Annotations\AppTranslationField;use App\Repository\Blog\BlogCategoriesRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;#[ORM\Entity(repositoryClass: BlogCategoriesRepository::class)]class BlogCategories implements TranslatableInterface{ use TimestampableEntity; use TranslatableTrait; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[AppTranslationField] private ?string $title = ""; #[ORM\Column(type: 'boolean')] private bool $isActive = true; #[ORM\ManyToMany(targetEntity: Blog::class, mappedBy: 'categories')] private $blogs; public function __construct() { $this->createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); $this->blogs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function isIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } /** * @return string|null */ public function getTitle(): ?string { return $this->title; } /** * @param string|null $title * @return BlogCategories */ public function setTitle(?string $title): BlogCategories { $this->title = $title; return $this; } /** * @return Collection<int, Blog> */ public function getBlogs(): Collection { return $this->blogs; } public function addBlog(Blog $blog): self { if (!$this->blogs->contains($blog)) { $this->blogs[] = $blog; $blog->addCategory($this); } return $this; } public function removeBlog(Blog $blog): self { if ($this->blogs->removeElement($blog)) { $blog->removeCategory($this); } return $this; }}