Log in
Model

CategoryLinkRepository

Magento\Catalog\Model\CategoryLinkRepository

What it does

This class manages the relationship between products and categories in Magento 2.

Developers use it to programmatically assign products to categories, remove products from categories, or update product positions within a category.

It provides a service layer for category-product link operations through repository methods that handle validation and error management.

Public Methods

  • save()
  • delete()
  • deleteByIds()
  • deleteBySkus()