src/Sulu/Component/DocumentManager/Subscriber/Behavior/Path/AutoNameSubscriber.php
private function getName(
        AutoNameBehavior $document,
        NodeInterface $parentNode,
        $autoRename = true,
        NodeInterface $node = null
    ) {
        $title = $document->getTitle();

        if (!$title) {
            throw new DocumentManagerException(
                sprintf(
                    'Document has no title (title is required for auto name behavior): %s)',
                    DocumentHelper::getDebugTitle($document)
                )
            );
        }

        $name = $this->slugifier->slugify($title);

        return $this->resolver->resolveName($parentNode, $name, $node, $autoRename);
    }
private function getName(
        AutoNameBehavior $document,
        NodeInterface $parentNode,
        $autoRename = true,
        NodeInterface $node = null
    ) {
        $title = $document->getTitle();

        if (!$title) {
            throw new DocumentManagerException(
                sprintf(
                    'Document has no title (title is required for auto name behavior): %s)',
                    DocumentHelper::getDebugTitle($document)
                )
            );
        }

        $name = $this->slugifier->slugify($title);

        return $this->resolver->resolveName($parentNode, $name, $node, $autoRename);
    }
private function getName ( AutoNameBehavior $ document , NodeInterface $ parentNode , $ autoRename = true , NodeInterface $ node = null ) { $ title = $ document -> getTitle ( ) ; if ( ! $ title ) { throw new DocumentManagerException ( sprintf ( 'Document has no title (title is required for auto name behavior): %s)' , DocumentHelper :: getDebugTitle ( $ document ) ) ) ; } $ name = $ this -> slugifier -> slugify ( $ title ) ; return $ this -> resolver -> resolveName ( $ parentNode , $ name , $ node , $ autoRename ) ; }
Returns unique name for given document and nodes.

@param AutoNameBehavior $document
@param NodeInterface $parentNode
@param NodeInterface|null $node
@param bool $autoRename

@return string

@throws DocumentManagerException
Returns unique name for given document and nodes .