ImageProcessorInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Api;
  7. use Magento\Framework\Api\Data\ImageContentInterface;
  8. use Magento\Framework\Exception\InputException;
  9. /**
  10. * Interface ImageProcessorInterface
  11. *
  12. * @api
  13. * @since 100.0.2
  14. */
  15. interface ImageProcessorInterface
  16. {
  17. /**
  18. * Process Data objects with image type custom attributes and update the custom attribute values with saved image
  19. * paths
  20. *
  21. * @api
  22. * @param CustomAttributesDataInterface $dataObjectWithCustomAttributes
  23. * @param string $entityType entity type
  24. * @param CustomAttributesDataInterface $previousCustomerData
  25. * @return CustomAttributesDataInterface
  26. */
  27. public function save(
  28. CustomAttributesDataInterface $dataObjectWithCustomAttributes,
  29. $entityType,
  30. CustomAttributesDataInterface $previousCustomerData = null
  31. );
  32. /**
  33. * Process image and save it to the entity's media directory
  34. *
  35. * @param string $entityType
  36. * @param ImageContentInterface $imageContent
  37. * @return string Relative path of the file where image was saved
  38. * @throws InputException
  39. */
  40. public function processImageContent($entityType, $imageContent);
  41. }