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

        $page = 1;
        foreach ($document->getParent()->getChildren() as $child) {
            if (!$child instanceof PageBehavior || $child->getUuid() === $document->getUuid()) {
                continue;
            }

            $childNode = $this->documentInspector->getNode($child);
            $childNode->setProperty($this->propertyEncoder->systemName(static::FIELD), ++$page);
        }
    }
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof PageBehavior) {
            return;
        }

        $page = 1;
        foreach ($document->getParent()->getChildren() as $child) {
            if (!$child instanceof PageBehavior || $child->getUuid() === $document->getUuid()) {
                continue;
            }

            $childNode = $this->documentInspector->getNode($child);
            $childNode->setProperty($this->propertyEncoder->systemName(static::FIELD), ++$page);
        }
    }
public function handleRemove ( RemoveEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof PageBehavior ) { return ; } $ page = 1 ; foreach ( $ document -> getParent ( ) -> getChildren ( ) as $ child ) { if ( ! $ child instanceof PageBehavior || $ child -> getUuid ( ) === $ document -> getUuid ( ) ) { continue ; } $ childNode = $ this -> documentInspector -> getNode ( $ child ) ; $ childNode -> setProperty ( $ this -> propertyEncoder -> systemName ( static :: FIELD ) , ++ $ page ) ; } }
Adjust the page-numbers of siblings when removing a page.

@param RemoveEvent $event
Adjust the page - numbers of siblings when removing a page .