Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MftfDom.php
Go to the documentation of this file.
1 <?php
8 
15 
21 {
32  public function __construct(
33  $xml,
34  $filename,
35  $exceptionCollector,
36  array $idAttributes = [],
37  $typeAttributeName = null,
38  $schemaFile = null,
39  $errorFormat = self::ERROR_FORMAT_DEFAULT
40  ) {
41  $this->schemaFile = $schemaFile;
42  $this->nodeMergingConfig = new NodeMergingConfig(new NodePathMatcher(), $idAttributes);
43  $this->typeAttributeName = $typeAttributeName;
44  $this->errorFormat = $errorFormat;
45  $this->dom = $this->initDom($xml, $filename, $exceptionCollector);
46  $this->rootNamespace = $this->dom->lookupNamespaceUri($this->dom->namespaceURI);
47  }
48 
57  public function merge($xml, $filename = null, $exceptionCollector = null)
58  {
59  $dom = $this->initDom($xml, $filename, $exceptionCollector);
60  $this->mergeNode($dom->documentElement, '');
61  }
62 
69  public function checkFilenameSuffix($filename, $suffix)
70  {
71  if (substr_compare($filename, $suffix, -strlen($suffix)) === 0) {
72  return true;
73  }
74  return false;
75  }
76 }
$suffix
Definition: name.phtml:27
merge($xml, $filename=null, $exceptionCollector=null)
Definition: MftfDom.php:57
mergeNode(\DOMElement $node, $parentPath)
Definition: Dom.php:121
__construct( $xml, $filename, $exceptionCollector, array $idAttributes=[], $typeAttributeName=null, $schemaFile=null, $errorFormat=self::ERROR_FORMAT_DEFAULT)
Definition: MftfDom.php:32