Log in
Model

ProductRepository

Magento\Catalog\Model\ProductRepository

What it does

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

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

It handles caching, validation, media gallery processing, product links, and ensures data integrity across different store views and websites.

Public Methods

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