src/Sulu/Component/DocumentManager/Subscriber/Behavior/Path/AutoNameSubscriber.php
public function handleScheduleRename(PersistEvent $event)
    {
        $document = $event->getDocument();

        if (!$event->getOption('auto_name')
            || !$document instanceof AutoNameBehavior
            || $event->getOption('auto_name_locale') !== $event->getLocale()
            || !$event->hasNode()
            || $event->getNode()->isNew()
        ) {
            return;
        }

        $node = $event->getNode();
        $name = $this->getName($document, $event->getParentNode(), $event->getOption('auto_rename'), $node);

        if ($name === $node->getName()) {
            return;
        }

        $uuid = $event->getNode()->getIdentifier();
        $this->scheduledRename[] = ['uuid' => $uuid, 'name' => $name, 'locale' => $event->getLocale()];
    }
public function handleScheduleRename(PersistEvent $event)
    {
        $document = $event->getDocument();

        if (!$event->getOption('auto_name')
            || !$document instanceof AutoNameBehavior
            || $event->getOption('auto_name_locale') !== $event->getLocale()
            || !$event->hasNode()
            || $event->getNode()->isNew()
        ) {
            return;
        }

        $node = $event->getNode();
        $name = $this->getName($document, $event->getParentNode(), $event->getOption('auto_rename'), $node);

        if ($name === $node->getName()) {
            return;
        }

        $uuid = $event->getNode()->getIdentifier();
        $this->scheduledRename[] = ['uuid' => $uuid, 'name' => $name, 'locale' => $event->getLocale()];
    }
public function handleScheduleRename ( PersistEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ event -> getOption ( 'auto_name' ) || ! $ document instanceof AutoNameBehavior || $ event -> getOption ( 'auto_name_locale' ) !== $ event -> getLocale ( ) || ! $ event -> hasNode ( ) || $ event -> getNode ( ) -> isNew ( ) ) { return ; } $ node = $ event -> getNode ( ) ; $ name = $ this -> getName ( $ document , $ event -> getParentNode ( ) , $ event -> getOption ( 'auto_rename' ) , $ node ) ; if ( $ name === $ node -> getName ( ) ) { return ; } $ uuid = $ event -> getNode ( ) -> getIdentifier ( ) ; $ this -> scheduledRename [ ] = [ 'uuid' => $ uuid , 'name' => $ name , 'locale' => $ event -> getLocale ( ) ] ; }
Renames node if necessary.

@param PersistEvent $event
Renames node if necessary .