SchemaLocator.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Locator for page layouts XSD schemas.
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Theme\Model\Layout\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. * @param UrnResolver $urnResolver
  20. */
  21. public function __construct(UrnResolver $urnResolver)
  22. {
  23. $this->_schema = $urnResolver->getRealPath('urn:magento:framework:View/PageLayout/etc/layouts.xsd');
  24. }
  25. /**
  26. * Get path to merged config schema
  27. *
  28. * @return string|null
  29. */
  30. public function getSchema()
  31. {
  32. return $this->_schema;
  33. }
  34. /**
  35. * Get path to per file validation schema
  36. *
  37. * @return string|null
  38. */
  39. public function getPerFileSchema()
  40. {
  41. return $this->_schema;
  42. }
  43. }