SchemaLocator.php 1.3 KB

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