src/Entity/CRM/ProductCategory.php line 11
<?phpnamespace App\Entity\CRM;use App\Repository\ProductCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProductCategoryRepository::class)]class ProductCategory{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $description = null;#[ORM\Column]private bool $isActive = true;#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: 'category')]private Collection $products;public function __construct(){$this->products = new ArrayCollection();}public function __toString(): string{return $this->id.' '.$this->name;}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 getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): self{$this->isActive = $isActive;return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): self{if (!$this->products->contains($product)) {$this->products->add($product);$product->addCategory($this);}return $this;}public function removeProduct(Product $product): self{if ($this->products->removeElement($product)) {$product->removeCategory($this);}return $this;}}