Log in
Model

SampleRepository

Magento\Downloadable\Model\SampleRepository

What it does

This repository class manages downloadable product samples in Magento 2.

Developers use it to retrieve, create, update, and delete sample files or URLs that customers can preview before purchasing downloadable products.

It handles validation, file uploads, and ensures samples are properly associated with their parent downloadable products.

Public Methods

  • getList()
  • getSamplesByProduct()
  • save()
  • delete()