<?phpnamespace App\Entity;use App\Repository\CategoryMasterRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CategoryMasterRepository::class) */class CategoryMaster{ /** * @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 $slugName; /** * @ORM\Column(type="string", length=255) */ private $image; /** * @ORM\OneToMany(targetEntity=Category::class, mappedBy="categoryMaster") */ private $categories; public function __construct() { $this->categories = 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 getSlugName(): ?string { return $this->slugName; } public function setSlugName(string $slugName): self { $this->slugName = $slugName; return $this; } public function getImage() { return $this->image; } public function setImage($image) { $this->image = $image; return $this; } /** * @return Collection|Category[] */ public function getCategories(): Collection { return $this->categories; } public function addCategory(Category $category): self { if (!$this->categories->contains($category)) { $this->categories[] = $category; $category->setCategoryMaster($this); } return $this; } public function removeCategory(Category $category): self { if ($this->categories->contains($category)) { $this->categories->removeElement($category); // set the owning side to null (unless already changed) if ($category->getCategoryMaster() === $this) { $category->setCategoryMaster(null); } } return $this; }}