Log in
Model

Link

Magento\Catalog\Model\ResourceModel\Product\Link

What it does

This resource model manages product link relationships in Magento 2, such as related products, up-sells, and cross-sells.

Developers use this class when they need to programmatically create, update, delete, or retrieve product associations and their attributes (like position or quantity).

It handles the database operations for linking products together and managing the link-specific data.

Public Methods

  • deleteProductLink()
  • getProductLinkId()
  • hasProductLinks()
  • saveProductLinks()
  • getAttributesByType()
  • getAttributeTypeTable()
  • getChildrenIds()
  • getParentIdsByChild()