/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Config/Dom/NodeMergingConfig.php
50 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework\Config\Dom; /** * Configuration of identifier attributes to be taken into account during merging */ class NodeMergingConfig { /** * @var NodePathMatcher */ private $nodePathMatcher; /** * Format: array('/node/path' => '<node_id_attribute>', ...) * * @var array */ private $idAttributes = []; /** * @param NodePathMatcher $nodePathMatcher * @param array $idAttributes */ public function __construct(NodePathMatcher $nodePathMatcher, array $idAttributes) { $this->nodePathMatcher = $nodePathMatcher; $this->idAttributes = $idAttributes; } /** * Retrieve name of an identifier attribute for a node * * @param string $nodeXpath * @return string|null */ public function getIdAttribute($nodeXpath) { foreach ($this->idAttributes as $pathPattern => $idAttribute) { if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) { return $idAttribute; } } return null; } }