Model

ProductRepository

Magento\Catalog\Model\ProductRepository

What it does

ProductRepository is the central service for managing product data in Magento 2.

Developers use it to retrieve, save, delete, and search for products through a standardized API.

It handles product caching, attribute management, media galleries, category assignments, and product links while ensuring data integrity across stores and websites.

Public Methods

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