private function parseFilters(\DOMXPath $xpath, $rootNodeName, $nodeName, $language = 'default')
    {
        $filters = [];
        $languagePath = sprintf("[@language='%s']", $language);
        $searchPath   = sprintf("/%s/%s/%s%s", self::ROOT_NODE_NAME, $rootNodeName, $nodeName, $languagePath);
        $filterNodes = $xpath->query($searchPath);
        foreach ($filterNodes as $filterNode) {
            $filterName = $filterNode->getAttribute('name');
            $filter     = ['type' => $filterNode->getAttribute('type')];
            foreach ($filterNode->childNodes as $childNode) {
                if ($childNode instanceof \DOMElement) {
                    try {
                        $filter[$childNode->tagName] = $this->jsonDecoder->decode($childNode->nodeValue);
                    } catch (\Exception $e) {
                        $filter[$childNode->tagName] = $childNode->nodeValue;
                    }
                }
            }
            $filters[$filterName] = $filter;
        }

        return $filters;
    }
private function parseFilters(\DOMXPath $xpath, $rootNodeName, $nodeName, $language = 'default')
    {
        $filters = [];
        $languagePath = sprintf("[@language='%s']", $language);
        $searchPath   = sprintf("/%s/%s/%s%s", self::ROOT_NODE_NAME, $rootNodeName, $nodeName, $languagePath);
        $filterNodes = $xpath->query($searchPath);
        foreach ($filterNodes as $filterNode) {
            $filterName = $filterNode->getAttribute('name');
            $filter     = ['type' => $filterNode->getAttribute('type')];
            foreach ($filterNode->childNodes as $childNode) {
                if ($childNode instanceof \DOMElement) {
                    try {
                        $filter[$childNode->tagName] = $this->jsonDecoder->decode($childNode->nodeValue);
                    } catch (\Exception $e) {
                        $filter[$childNode->tagName] = $childNode->nodeValue;
                    }
                }
            }
            $filters[$filterName] = $filter;
        }

        return $filters;
    }
private function parseFilters ( \ DOMXPath $ xpath , $ rootNodeName , $ nodeName , $ language = 'default' ) { $ filters = [ ] ; $ languagePath = sprintf ( "[@language='%s']" , $ language ) ; $ searchPath = sprintf ( "/%s/%s/%s%s" , self :: ROOT_NODE_NAME , $ rootNodeName , $ nodeName , $ languagePath ) ; $ filterNodes = $ xpath -> query ( $ searchPath ) ; foreach ( $ filterNodes as $ filterNode ) { $ filterName = $ filterNode -> getAttribute ( 'name' ) ; $ filter = [ 'type' => $ filterNode -> getAttribute ( 'type' ) ] ; foreach ( $ filterNode -> childNodes as $ childNode ) { if ( $ childNode instanceof \ DOMElement ) { try { $ filter [ $ childNode -> tagName ] = $ this -> jsonDecoder -> decode ( $ childNode -> nodeValue ) ; } catch ( \ Exception $ e ) { $ filter [ $ childNode -> tagName ] = $ childNode -> nodeValue ; } } } $ filters [ $ filterName ] = $ filter ; } return $ filters ; }
Filters parser by language.

@param \DOMXPath $xpath        XPath access to the document parsed.
@param string    $rootNodeName Parsing root node.
@param string    $nodeName     Name of the nodes look up.
@param string    $language     Language searched.

@return array
Filters parser by language .