LinkRepositoryInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\LinkInterface;
  8. use Magento\Catalog\Api\Data\ProductInterface;
  9. /**
  10. * Interface LinkRepositoryInterface
  11. * @package Magento\Downloadable\Api
  12. * @api
  13. * @since 100.0.2
  14. */
  15. interface LinkRepositoryInterface
  16. {
  17. /**
  18. * List of links with associated samples
  19. *
  20. * @param string $sku
  21. * @return \Magento\Downloadable\Api\Data\LinkInterface[]
  22. */
  23. public function getList($sku);
  24. /**
  25. * List of links with associated samples
  26. *
  27. * @param \Magento\Catalog\Api\Data\ProductInterface $product
  28. * @return \Magento\Downloadable\Api\Data\LinkInterface[]
  29. */
  30. public function getLinksByProduct(ProductInterface $product);
  31. /**
  32. * Update downloadable link of the given product (link type and its resources cannot be changed)
  33. *
  34. * @param string $sku
  35. * @param \Magento\Downloadable\Api\Data\LinkInterface $link
  36. * @param bool $isGlobalScopeContent
  37. * @return int
  38. */
  39. public function save($sku, LinkInterface $link, $isGlobalScopeContent = true);
  40. /**
  41. * Delete downloadable link
  42. *
  43. * @param int $id
  44. * @return bool
  45. */
  46. public function delete($id);
  47. }