SchemaLocator.php 1.2 KB

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