Log in
Repository

CategoryLinkRepositoryInterface

Magento\Catalog\Api\CategoryLinkRepositoryInterface

What it does

This repository interface manages the assignment and removal of products to/from categories in Magento 2.

Developers use this to programmatically link or unlink products from specific categories, either by passing a CategoryProductLinkInterface object or by using category ID and product SKU directly.

It provides a standardized API for managing product-category relationships without directly manipulating database tables.

Public Methods

  • save()
  • delete()
  • deleteByIds()