protected function getRelativeNodePathByUriPathSegmentProperties(NodeInterface $siteNode, $relativeRequestPath)
{
$relativeNodePathSegments = [];
$node = $siteNode;
foreach (explode('/', $relativeRequestPath) as $pathSegment) {
$foundNodeInThisSegment = false;
foreach ($node->getChildNodes('Neos.Neos:Document') as $node) {
/** @var NodeInterface $node */
if ($node->getProperty('uriPathSegment') === $pathSegment) {
$relativeNodePathSegments[] = $node->getName();
$foundNodeInThisSegment = true;
break;
}
}
if (!$foundNodeInThisSegment) {
return false;
}
}
return implode('/', $relativeNodePathSegments);
}