Log in
Model

CategoryLink

Magento\Catalog\Model\CategoryLink

What it does

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

Developers use this when programmatically assigning products to categories or managing product ordering within categories through the API or custom code.

Public Methods

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