Skip to main content
deleted 2 characters in body
Source Link
Nero Phung
  • 1.3k
  • 4
  • 12
  • 24

You can see in the core. The class \Magento\Catalog\Model\ProductRepository implements interface \Magento\Catalog\Api\ProductRepositoryInterface. So basically, you can use the function get($sku) of both. The difference is you the ProductRepositoryInterface usually use with the API as you see. If you don't use the API, use the ProductRepository.

The ProductRepositoryInterfaceProductRepositoryInterface with no content in the method so you can find it in var/generation/Magento/Catalog/Api/ProductRepositoryInterface. Magento will auto generate the code.

There are what I find out! Hope it help!

You can see in the core. The class \Magento\Catalog\Model\ProductRepository implements interface \Magento\Catalog\Api\ProductRepositoryInterface. So basically, you can use the function get($sku) of both. The difference is you the ProductRepositoryInterface usually use with the API as you see. If you don't use the API, use the ProductRepository.

The ProductRepositoryInterface with no content in the method so you can find it in var/generation/Magento/Catalog/Api/ProductRepositoryInterface. Magento will auto generate the code.

There are what I find out! Hope it help!

You can see in the core. The class \Magento\Catalog\Model\ProductRepository implements interface \Magento\Catalog\Api\ProductRepositoryInterface. So basically, you can use the function get($sku) of both. The difference is the ProductRepositoryInterface usually use with the API as you see. If you don't use the API, use the ProductRepository.

The ProductRepositoryInterface with no content in the method so you can find it in var/generation/Magento/Catalog/Api/ProductRepositoryInterface. Magento will auto generate the code.

There are what I find out! Hope it help!

Source Link
Nero Phung
  • 1.3k
  • 4
  • 12
  • 24

You can see in the core. The class \Magento\Catalog\Model\ProductRepository implements interface \Magento\Catalog\Api\ProductRepositoryInterface. So basically, you can use the function get($sku) of both. The difference is you the ProductRepositoryInterface usually use with the API as you see. If you don't use the API, use the ProductRepository.

The ProductRepositoryInterface with no content in the method so you can find it in var/generation/Magento/Catalog/Api/ProductRepositoryInterface. Magento will auto generate the code.

There are what I find out! Hope it help!