Log in
Model

CategoryProductLink

Magento\Catalog\Model\CategoryProductLink

What it does

This class represents the relationship between a product and a category in Magento 2, storing the product's SKU, its position within the category, and the category ID.

Developers use this model when working with category-product assignments through the API, particularly when adding, updating, or retrieving products assigned to categories with specific ordering positions.

Public Methods

  • getSku()
  • getPosition()
  • getCategoryId()
  • setSku()
  • setPosition()
  • setCategoryId()
  • getExtensionAttributes()
  • setExtensionAttributes()