Log in
Model

Link

Magento\Catalog\Model\ProductLink\Link

What it does

This class represents a product link relationship in Magento 2, such as related products, up-sells, or cross-sells.

Developers use this model to programmatically create, read, and manage connections between products, including storing the link type, linked product SKU, position, and other relationship data.

It implements the ProductLinkInterface and provides getter/setter methods for all link attributes.

Public Methods

  • __toArray()
  • getSku()
  • getLinkType()
  • getLinkedProductSku()
  • getLinkedProductType()
  • getPosition()
  • setSku()
  • setLinkType()
  • setLinkedProductSku()
  • setLinkedProductType()
  • setPosition()
  • getExtensionAttributes()
  • setExtensionAttributes()