Log in
Model

CategoryLinkManagement

Magento\Catalog\Model\CategoryLinkManagement

What it does

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

Developers use it to retrieve which products are assigned to a specific category or to programmatically assign/unassign products to multiple categories.

It handles the underlying complexity of saving category-product links and triggering necessary reindexing operations.

Public Methods

  • getAssignedProducts()
  • assignProductToCategories()