Jackalope\Transport\DoctrineDBAL\Client::xmlToColumns PHP Method

xmlToColumns() protected method

Convert the node XML to stdClass node representation containing only the given properties
protected xmlToColumns ( string $xml, array $propertyNames ) : stdClass
$xml string
$propertyNames array
return stdClass
    protected function xmlToColumns($xml, $propertyNames)
    {
        $data = new \stdClass();
        $dom = new \DOMDocument('1.0');
        $dom->loadXml($xml);
        $dom->formatOutput = true;
        $xpath = new \DOMXPath($dom);
        $columns = array();
        $propertyEls = array();
        foreach ($propertyNames as $propertyName) {
            $els = $xpath->query(sprintf('.//sv:property[@sv:name="%s"]', $propertyName));
            if ($els->length === 0) {
                continue;
            }
            $propertyEl = $els->item(0);
            $this->mapPropertyFromElement($propertyEl, $data);
        }
        return $data;
    }