private function getNodeChildrenProperties(NodePath $nodePath, string $property) : array
    {
        $nodeData = $this->getNode($nodePath);
        $result = [];
        if (!empty($nodeData)) {
            if ($nodeData['nodeType'] == 'object') {
                foreach ($nodeData as $itemName => $value) {
                    if (is_array($value)) {
                        $itemName = $this->decodeNodeName($itemName);
                        // it is a child node
                        if (isset($value[$property])) {
                            $result[$itemName] = $value[$property];
                        } else {
                            $result[$itemName] = null;
                        }
                    }
                }
            } elseif ($nodeData['nodeType'] == 'scalar') {
                foreach ($nodeData as $itemName => $value) {
                    if ($itemName == $property) {
                        $result[$nodePath->getLast()] = $value;
                    }
                }
            }
        }
        return $result;
    }
private function getNodeChildrenProperties(NodePath $nodePath, string $property) : array
    {
        $nodeData = $this->getNode($nodePath);
        $result = [];
        if (!empty($nodeData)) {
            if ($nodeData['nodeType'] == 'object') {
                foreach ($nodeData as $itemName => $value) {
                    if (is_array($value)) {
                        $itemName = $this->decodeNodeName($itemName);
                        // it is a child node
                        if (isset($value[$property])) {
                            $result[$itemName] = $value[$property];
                        } else {
                            $result[$itemName] = null;
                        }
                    }
                }
            } elseif ($nodeData['nodeType'] == 'scalar') {
                foreach ($nodeData as $itemName => $value) {
                    if ($itemName == $property) {
                        $result[$nodePath->getLast()] = $value;
                    }
                }
            }
        }
        return $result;
    }
private function getNodeChildrenProperties ( NodePath $ nodePath , string $ property ) : array { $ nodeData = $ this -> getNode ( $ nodePath ) ; $ result = [ ] ; if ( ! empty ( $ nodeData ) ) { if ( $ nodeData [ 'nodeType' ] == 'object' ) { foreach ( $ nodeData as $ itemName => $ value ) { if ( is_array ( $ value ) ) { $ itemName = $ this -> decodeNodeName ( $ itemName ) ; // it is a child node if ( isset ( $ value [ $ property ] ) ) { $ result [ $ itemName ] = $ value [ $ property ] ; } else { $ result [ $ itemName ] = null ; } } } } elseif ( $ nodeData [ 'nodeType' ] == 'scalar' ) { foreach ( $ nodeData as $ itemName => $ value ) { if ( $ itemName == $ property ) { $ result [ $ nodePath -> getLast ( ) ] = $ value ; } } } } return $ result ; }
Return a particular property of a the children of the node.
@param NodePath $nodePath Node path
@param string $property Property name (e.g. 'nodeType').
@return array
Return a particular property of a the children of the node .