Neos\Neos\Routing\FrontendNodeRoutePartHandler::removeContextFromPath PHP Метод

removeContextFromPath() защищенный Метод

protected removeContextFromPath ( string $path ) : string
$path string an absolute or relative node path which possibly contains context information, for example "/sites/somesite/the/node/path@some-workspace"
Результат string the same path without context information
    protected function removeContextFromPath($path)
    {
        if ($path === '' || NodePaths::isContextPath($path) === false) {
            return $path;
        }
        try {
            $nodePathAndContext = NodePaths::explodeContextPath($path);
            // This is a workaround as we potentially prepend the context path with "/" in buildContextFromRequestPath to create a valid context path,
            // the code in this class expects an empty nodePath though for the site node, so we remove it again at this point.
            return $nodePathAndContext['nodePath'] === '/' ? '' : $nodePathAndContext['nodePath'];
        } catch (\InvalidArgumentException $exception) {
        }
        return null;
    }