ImageUploadConfig.php 930 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Backend\Block\DataProviders;
  8. use Magento\Framework\View\Element\Block\ArgumentInterface;
  9. use Magento\Backend\Model\Image\UploadResizeConfigInterface;
  10. /**
  11. * Provides additional data for image uploader
  12. */
  13. class ImageUploadConfig implements ArgumentInterface
  14. {
  15. /**
  16. * @var UploadResizeConfigInterface
  17. */
  18. private $imageUploadConfig;
  19. /**
  20. * @param UploadResizeConfigInterface $imageUploadConfig
  21. */
  22. public function __construct(UploadResizeConfigInterface $imageUploadConfig)
  23. {
  24. $this->imageUploadConfig = $imageUploadConfig;
  25. }
  26. /**
  27. * Get image resize configuration
  28. *
  29. * @return int
  30. */
  31. public function getIsResizeEnabled(): int
  32. {
  33. return (int)$this->imageUploadConfig->isResizeEnabled();
  34. }
  35. }