public function convert($source)
    {
        // Due to SimpleXML not deleting comment we have to strip them before using the source.
        $source = $this->stripComments($source);

        /** @var \DOMNodeList $requestNodes */
        $requestNodes = $source->getElementsByTagName('request');
        $xpath        = new \DOMXPath($source);
        $requests     = [];

        foreach ($requestNodes as $requestNode) {
            $simpleXmlNode = simplexml_import_dom($requestNode);
            /** @var \DOMElement $requestNode */
            $name                             = $requestNode->getAttribute('name');
            $request                          = $this->mergeAttributes((array) $simpleXmlNode);
            $request['filters']               = $this->parseFilters($xpath, $requestNode);
            $request['aggregations']          = $this->parseAggregations($xpath, $requestNode);
            $request['aggregationsProviders'] = $this->parseAggregationsProviders($xpath, $requestNode);
            $requests[$name]                  = $request;
        }

        return $requests;
    }
public function convert($source)
    {
        // Due to SimpleXML not deleting comment we have to strip them before using the source.
        $source = $this->stripComments($source);

        /** @var \DOMNodeList $requestNodes */
        $requestNodes = $source->getElementsByTagName('request');
        $xpath        = new \DOMXPath($source);
        $requests     = [];

        foreach ($requestNodes as $requestNode) {
            $simpleXmlNode = simplexml_import_dom($requestNode);
            /** @var \DOMElement $requestNode */
            $name                             = $requestNode->getAttribute('name');
            $request                          = $this->mergeAttributes((array) $simpleXmlNode);
            $request['filters']               = $this->parseFilters($xpath, $requestNode);
            $request['aggregations']          = $this->parseAggregations($xpath, $requestNode);
            $request['aggregationsProviders'] = $this->parseAggregationsProviders($xpath, $requestNode);
            $requests[$name]                  = $request;
        }

        return $requests;
    }
public function convert ( $ source ) { // Due to SimpleXML not deleting comment we have to strip them before using the source. $ source = $ this -> stripComments ( $ source ) ; /** @var \DOMNodeList $requestNodes */ $ requestNodes = $ source -> getElementsByTagName ( 'request' ) ; $ xpath = new \ DOMXPath ( $ source ) ; $ requests = [ ] ; foreach ( $ requestNodes as $ requestNode ) { $ simpleXmlNode = simplexml_import_dom ( $ requestNode ) ; /** @var \DOMElement $requestNode */ $ name = $ requestNode -> getAttribute ( 'name' ) ; $ request = $ this -> mergeAttributes ( ( array ) $ simpleXmlNode ) ; $ request [ 'filters' ] = $ this -> parseFilters ( $ xpath , $ requestNode ) ; $ request [ 'aggregations' ] = $ this -> parseAggregations ( $ xpath , $ requestNode ) ; $ request [ 'aggregationsProviders' ] = $ this -> parseAggregationsProviders ( $ xpath , $ requestNode ) ; $ requests [ $ name ] = $ request ; } return $ requests ; }
Convert config.

@param \DOMDocument $source XML file read.

@return array
Convert config .