Log in
Repository

ProductRepositoryInterface

Magento\Catalog\Api\ProductRepositoryInterface

What it does

This interface defines the contract for managing product data in Magento 2.

Developers use it to create, retrieve, update, and delete products programmatically, as well as to fetch product lists with search criteria.

It's the primary API for all product-related operations and should be used instead of direct model manipulation for better compatibility and maintainability.

Public Methods

  • save()
  • get()
  • getById()
  • delete()
  • deleteById()
  • getList()