SchemaLocator.php 1.2 KB

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