SchemaLocator.php 1.0 KB

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