DomMergerInterface.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\View\Element\UiComponent\Config;
  7. /**
  8. * Interface DomMergerInterface
  9. */
  10. interface DomMergerInterface
  11. {
  12. /**
  13. * Merge $xml into DOM document
  14. *
  15. * @param string $xml
  16. * @return void
  17. */
  18. public function merge($xml);
  19. /**
  20. * Recursive merging of the \DOMElement into the original document
  21. *
  22. * Algorithm:
  23. * 1. Find the same node in original document
  24. * 2. Extend and override original document node attributes and scalar value if found
  25. * 3. Append new node if original document doesn't have the same node
  26. *
  27. * @param \DOMElement $node
  28. * @throws \Magento\Framework\Exception\LocalizedException
  29. * @return void
  30. */
  31. public function mergeNode(\DOMElement $node);
  32. /**
  33. * Get DOM document
  34. *
  35. * @return \DOMDocument
  36. */
  37. public function getDom();
  38. /**
  39. * Set DOM document
  40. *
  41. * @param \DOMDocument $domDocument
  42. * @return void
  43. */
  44. public function setDom(\DOMDocument $domDocument);
  45. /**
  46. * Unset DOM document
  47. *
  48. * @return void
  49. */
  50. public function unsetDom();
  51. /**
  52. * Validate self contents towards to specified schema
  53. *
  54. * @param string $schemaFileName
  55. * @return array
  56. */
  57. public function validate($schemaFileName);
  58. }