ProductAttributeMediaGalleryManagementInterface.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Product Media Attribute Write Service
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Catalog\Api;
  9. /**
  10. * @todo implement this interface as a \Magento\Catalog\Model\Product\Attribute\Media\GalleryManagement.
  11. * Move logic from service there.
  12. * @api
  13. * @since 100.0.2
  14. */
  15. interface ProductAttributeMediaGalleryManagementInterface
  16. {
  17. /**
  18. * Create new gallery entry
  19. *
  20. * @param string $sku
  21. * @param \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $entry
  22. * @return int gallery entry ID
  23. * @throws \Magento\Framework\Exception\InputException
  24. * @throws \Magento\Framework\Exception\NoSuchEntityException
  25. * @throws \Magento\Framework\Exception\StateException
  26. */
  27. public function create(
  28. $sku,
  29. \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $entry
  30. );
  31. /**
  32. * Update gallery entry
  33. *
  34. * @param string $sku
  35. * @param \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $entry
  36. * @return bool
  37. * @throws \Magento\Framework\Exception\NoSuchEntityException
  38. * @throws \Magento\Framework\Exception\StateException
  39. */
  40. public function update(
  41. $sku,
  42. \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $entry
  43. );
  44. /**
  45. * Remove gallery entry
  46. *
  47. * @param string $sku
  48. * @param int $entryId
  49. * @return bool
  50. * @throws \Magento\Framework\Exception\NoSuchEntityException
  51. * @throws \Magento\Framework\Exception\StateException
  52. */
  53. public function remove($sku, $entryId);
  54. /**
  55. * Return information about gallery entry
  56. *
  57. * @param string $sku
  58. * @param int $entryId
  59. * @throws \Magento\Framework\Exception\NoSuchEntityException
  60. * @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface
  61. */
  62. public function get($sku, $entryId);
  63. /**
  64. * Retrieve the list of gallery entries associated with given product
  65. *
  66. * @param string $sku
  67. * @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
  68. */
  69. public function getList($sku);
  70. }