SchemaLocator.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Attributes config schema locator
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Sales\Model\Order\Pdf\Config;
  9. use Magento\Framework\Module\Dir;
  10. class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
  11. {
  12. /**
  13. * Path to corresponding XSD file with validation rules for merged configs
  14. *
  15. * @var string
  16. */
  17. private $_schema;
  18. /**
  19. * Path to corresponding XSD file with validation rules for individual configs
  20. *
  21. * @var string
  22. */
  23. private $_schemaFile;
  24. /**
  25. * @param \Magento\Framework\Module\Dir\Reader $moduleReader
  26. */
  27. public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader)
  28. {
  29. $dir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Sales');
  30. $this->_schema = $dir . '/pdf.xsd';
  31. $this->_schemaFile = $dir . '/pdf_file.xsd';
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function getSchema()
  37. {
  38. return $this->_schema;
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function getPerFileSchema()
  44. {
  45. return $this->_schemaFile;
  46. }
  47. }