src/Sulu/Component/Content/Document/Subscriber/ResourceSegmentSubscriber.php
public function updateMovedDocument(MoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ResourceSegmentBehavior) {
            return;
        }

        $webspaceKey = $this->documentInspector->getWebspace($event->getDocument());
        if (!$webspaceKey) {
            return;
        }

        $resourceLocatorStrategy = $this->resourceLocatorStrategyPool->getStrategyByWebspaceKey($webspaceKey);
        if (ResourceLocatorStrategyInterface::INPUT_TYPE_LEAF !== $resourceLocatorStrategy->getInputType()) {
            return;
        }

        $this->updateRoute($document, true);
    }
public function updateMovedDocument(MoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ResourceSegmentBehavior) {
            return;
        }

        $webspaceKey = $this->documentInspector->getWebspace($event->getDocument());
        if (!$webspaceKey) {
            return;
        }

        $resourceLocatorStrategy = $this->resourceLocatorStrategyPool->getStrategyByWebspaceKey($webspaceKey);
        if (ResourceLocatorStrategyInterface::INPUT_TYPE_LEAF !== $resourceLocatorStrategy->getInputType()) {
            return;
        }

        $this->updateRoute($document, true);
    }
public function updateMovedDocument ( MoveEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof ResourceSegmentBehavior ) { return ; } $ webspaceKey = $ this -> documentInspector -> getWebspace ( $ event -> getDocument ( ) ) ; if ( ! $ webspaceKey ) { return ; } $ resourceLocatorStrategy = $ this -> resourceLocatorStrategyPool -> getStrategyByWebspaceKey ( $ webspaceKey ) ; if ( ResourceLocatorStrategyInterface :: INPUT_TYPE_LEAF !== $ resourceLocatorStrategy -> getInputType ( ) ) { return ; } $ this -> updateRoute ( $ document , true ) ; }
Moves the routes for all localizations of the document in the event.

@param MoveEvent $event
Moves the routes for all localizations of the document in the event .