Config.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Pdf config
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Sales\Model\Order\Pdf;
  9. /**
  10. * Class Config
  11. */
  12. class Config
  13. {
  14. /**
  15. * @var \Magento\Framework\Config\DataInterface
  16. */
  17. protected $_dataStorage;
  18. /**
  19. * @param \Magento\Framework\Config\DataInterface $dataStorage
  20. */
  21. public function __construct(\Magento\Framework\Config\DataInterface $dataStorage)
  22. {
  23. $this->_dataStorage = $dataStorage;
  24. }
  25. /**
  26. * Get renderer configuration data by type
  27. *
  28. * @param string $pageType
  29. * @return array
  30. */
  31. public function getRenderersPerProduct($pageType)
  32. {
  33. return $this->_dataStorage->get("renderers/{$pageType}", []);
  34. }
  35. /**
  36. * Get list of settings for showing totals in PDF
  37. *
  38. * @return array
  39. */
  40. public function getTotals()
  41. {
  42. return $this->_dataStorage->get('totals', []);
  43. }
  44. }