Neos\ContentRepository\Domain\Service\ImportExport\NodeImportService::getParentPath PHP Method

getParentPath() protected method

Provides the parent of the given path
protected getParentPath ( string $path ) : string
$path string path to get parent for
return string parent path
    protected function getParentPath($path)
    {
        if ($path === '/') {
            return '';
        }
        $endIndex = strrpos($path, '/');
        $index = strpos($path, '/');
        // path is something like /nodeInRootSpace
        if ($index === $endIndex) {
            return '/';
        } else {
            // node is something like /node/not/in/root/space
            return substr($path, 0, $endIndex);
        }
    }