Model
Sample
Magento\Downloadable\Model\Sample
What it does
This model represents a downloadable product sample in Magento 2, allowing customers to preview content before purchasing.
Developers use this class to manage sample files (uploaded or URL-based), including their titles, sort order, and file paths.
It provides getter/setter methods for all sample attributes and handles saving sample titles to the database.
Public Methods
- afterSave()
- getUrl()
- getBaseTmpPath()
- getBasePath()
- getSearchableData()
- getTitle()
- getSortOrder()
- getSampleType()
- getSampleFile()
- getSampleFileContent()
- getSampleUrl()
- setTitle()
- setSortOrder()
- setSampleType()
- setSampleFile()
- setSampleFileContent()
- setSampleUrl()
- getExtensionAttributes()
- setExtensionAttributes()