Document/Subscriber/PageSubscriber.php
public function handleReorder(ReorderEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof PageBehavior) {
            return;
        }

        $propertyName = $this->propertyEncoder->systemName(static::FIELD);
        $parentNode = $this->documentInspector->getNode($document->getParent());

        $page = 1;
        foreach ($parentNode->getNodes() as $childNode) {
            $child = $this->documentManager->find($childNode->getIdentifier(), $event->getLocale());
            if (!$child instanceof PageBehavior) {
                continue;
            }

            $childNode->setProperty($propertyName, ++$page);
            $child->setPageNumber($page);
        }
    }
public function handleReorder(ReorderEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof PageBehavior) {
            return;
        }

        $propertyName = $this->propertyEncoder->systemName(static::FIELD);
        $parentNode = $this->documentInspector->getNode($document->getParent());

        $page = 1;
        foreach ($parentNode->getNodes() as $childNode) {
            $child = $this->documentManager->find($childNode->getIdentifier(), $event->getLocale());
            if (!$child instanceof PageBehavior) {
                continue;
            }

            $childNode->setProperty($propertyName, ++$page);
            $child->setPageNumber($page);
        }
    }
public function handleReorder ( ReorderEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof PageBehavior ) { return ; } $ propertyName = $ this -> propertyEncoder -> systemName ( static :: FIELD ) ; $ parentNode = $ this -> documentInspector -> getNode ( $ document -> getParent ( ) ) ; $ page = 1 ; foreach ( $ parentNode -> getNodes ( ) as $ childNode ) { $ child = $ this -> documentManager -> find ( $ childNode -> getIdentifier ( ) , $ event -> getLocale ( ) ) ; if ( ! $ child instanceof PageBehavior ) { continue ; } $ childNode -> setProperty ( $ propertyName , ++ $ page ) ; $ child -> setPageNumber ( $ page ) ; } }
Adjust the page-numbers of siblings when reordering a page.

@param ReorderEvent $event
Adjust the page - numbers of siblings when reordering a page .