eZ\Publish\Core\FieldType\RichText\Converter\Render\Template::getNodeDepth PHP Method

getNodeDepth() protected method

Returns depth of given $node in a DOMDocument.
protected getNodeDepth ( DomNode $node ) : integer
$node DomNode
return integer
    protected function getNodeDepth(DomNode $node)
    {
        $depth = -2;
        while ($node) {
            ++$depth;
            $node = $node->parentNode;
        }
        return $depth;
    }