Log in
Model

Link

Magento\Catalog\Model\ProductLink\Link

What it does

This class represents a product link relationship in Magento 2, managing associations between products like related products, upsells, or cross-sells.

Developers use this model to programmatically create, retrieve, or modify product link data including the parent SKU, linked product SKU, link type, and display position.

It implements the ProductLinkInterface and serves as a data transfer object for the product linking API.

Public Methods

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