Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
NodeMergingConfig.php
Go to the documentation of this file.
1 <?php
7 
12 {
16  private $nodePathMatcher;
17 
23  private $idAttributes = [];
24 
29  public function __construct(NodePathMatcher $nodePathMatcher, array $idAttributes)
30  {
31  $this->nodePathMatcher = $nodePathMatcher;
32  $this->idAttributes = $idAttributes;
33  }
34 
41  public function getIdAttribute($nodeXpath)
42  {
43  foreach ($this->idAttributes as $pathPattern => $idAttribute) {
44  if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) {
45  return $idAttribute;
46  }
47  }
48  return null;
49  }
50 }
__construct(NodePathMatcher $nodePathMatcher, array $idAttributes)
$pathPattern