SchemaLocator.php 1.3 KB

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