Log in
Model

CategoryLink

Magento\Catalog\Model\ResourceModel\Product\CategoryLink

What it does

This class manages the relationship between products and categories in Magento 2's catalog system.

Developers use it to retrieve, save, update, or delete category assignments for products, handling the many-to-many relationship data in the database.

It's particularly useful when programmatically managing product categorization, ensuring data integrity by validating category IDs before saving.

Public Methods

  • getCategoryLinks()
  • saveCategoryLinks()
  • updateCategoryLinks()