Jackalope\Transport\Jackrabbit\Client::getNodeReferences PHP Method

getNodeReferences() protected method

protected getNodeReferences ( string $path, string $name = null, boolean $weak_reference = false ) : array
$path string the path for which we need the references
$name string the name of the referencing properties or null for all
$weak_reference boolean whether to get weak or strong references
return array list of paths to nodes that reference $path
    protected function getNodeReferences($path, $name = null, $weak_reference = false)
    {
        $path = $this->encodeAndValidatePathForDavex($path);
        $identifier = $weak_reference ? 'weakreferences' : 'references';
        $request = $this->getRequest(Request::PROPFIND, $path);
        $request->setBody($this->buildPropfindRequest(array('dcr:' . $identifier)));
        $request->setDepth(0);
        $dom = $request->executeDom();
        $references = array();
        foreach ($dom->getElementsByTagNameNS(self::NS_DCR, $identifier) as $node) {
            foreach ($node->getElementsByTagNameNS(self::NS_DAV, 'href') as $ref) {
                $refpath = str_replace($this->workspaceUriRoot, '', urldecode($ref->textContent));
                $refpath = $this->removeTrailingSlash($refpath);
                if (null === $name || PathHelper::getNodeName($refpath) === $name) {
                    $references[] = $refpath;
                }
            }
        }
        return $references;
    }