src/Sulu/Bundle/DocumentManagerBundle/Bridge/DocumentInspector.php
public function getContentPath(PathBehavior $document)
    {
        $path = $this->getPath($document);
        $webspaceKey = $this->getWebspace($document);

        return str_replace(
            sprintf(
                '/%s/%s/%s',
                $this->pathSegmentRegistry->getPathSegment('base'),
                $webspaceKey,
                $this->pathSegmentRegistry->getPathSegment('content')
            ),
            '',
            $path
        );
    }
public function getContentPath(PathBehavior $document)
    {
        $path = $this->getPath($document);
        $webspaceKey = $this->getWebspace($document);

        return str_replace(
            sprintf(
                '/%s/%s/%s',
                $this->pathSegmentRegistry->getPathSegment('base'),
                $webspaceKey,
                $this->pathSegmentRegistry->getPathSegment('content')
            ),
            '',
            $path
        );
    }
public function getContentPath ( PathBehavior $ document ) { $ path = $ this -> getPath ( $ document ) ; $ webspaceKey = $ this -> getWebspace ( $ document ) ; return str_replace ( sprintf ( '/%s/%s/%s' , $ this -> pathSegmentRegistry -> getPathSegment ( 'base' ) , $ webspaceKey , $ this -> pathSegmentRegistry -> getPathSegment ( 'content' ) ) , '' , $ path ) ; }
Return the path of the document in relation to the content root.

TODO: We need a better solution for retrieving webspace paths (the existing
"session manager" is not a good solution).

@param PathBehavior $document

@return string
Return the path of the document in relation to the content root .