src/Sulu/Bundle/PageBundle/Document/Subscriber/PublishSubscriber.php
public function createNodeInPublicWorkspace(PersistEvent $event)
    {
        $node = $event->getNode();

        if ($node->isNew()) {
            $this->createNodesWithUuid($node);

            return;
        }

        $liveNode = $this->getLiveNode($event->getDocument());
        $nodeName = $node->getName();

        if ($liveNode->getName() !== $nodeName) {
            $liveNode->rename($nodeName);
        }
    }
public function createNodeInPublicWorkspace(PersistEvent $event)
    {
        $node = $event->getNode();

        if ($node->isNew()) {
            $this->createNodesWithUuid($node);

            return;
        }

        $liveNode = $this->getLiveNode($event->getDocument());
        $nodeName = $node->getName();

        if ($liveNode->getName() !== $nodeName) {
            $liveNode->rename($nodeName);
        }
    }
public function createNodeInPublicWorkspace ( PersistEvent $ event ) { $ node = $ event -> getNode ( ) ; if ( $ node -> isNew ( ) ) { $ this -> createNodesWithUuid ( $ node ) ; return ; } $ liveNode = $ this -> getLiveNode ( $ event -> getDocument ( ) ) ; $ nodeName = $ node -> getName ( ) ; if ( $ liveNode -> getName ( ) !== $ nodeName ) { $ liveNode -> rename ( $ nodeName ) ; } }
Creates the node with the same UUID in the public workspace if it does not exist yet. In case it does it will
be renamed if necessary.

@param PersistEvent $event
Creates the node with the same UUID in the public workspace if it does not exist yet . In case it does it will be renamed if necessary .