SampleRepositoryInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Downloadable\Api;
  7. use Magento\Downloadable\Api\Data\SampleInterface;
  8. /**
  9. * Interface SampleRepositoryInterface
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface SampleRepositoryInterface
  14. {
  15. /**
  16. * List of samples for downloadable product
  17. *
  18. * @param string $sku
  19. * @return \Magento\Downloadable\Api\Data\SampleInterface[]
  20. */
  21. public function getList($sku);
  22. /**
  23. * List of links with associated samples
  24. *
  25. * @param \Magento\Catalog\Api\Data\ProductInterface $product
  26. * @return \Magento\Downloadable\Api\Data\SampleInterface[]
  27. */
  28. public function getSamplesByProduct(\Magento\Catalog\Api\Data\ProductInterface $product);
  29. /**
  30. * Update downloadable sample of the given product
  31. *
  32. * @param string $sku
  33. * @param \Magento\Downloadable\Api\Data\SampleInterface $sample
  34. * @param bool $isGlobalScopeContent
  35. * @return int
  36. */
  37. public function save(
  38. $sku,
  39. SampleInterface $sample,
  40. $isGlobalScopeContent = true
  41. );
  42. /**
  43. * Delete downloadable sample
  44. *
  45. * @param int $id
  46. * @return bool
  47. */
  48. public function delete($id);
  49. }