SchemaLocator.php 1.3 KB

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