src/EventListener/ModelRelationship/TreeEnforcingListener.php
private function handleAfter(
        ModelId $after,
        RelationshipManager $relationships,
        ModelCollector $collector,
        ModelInterface $model
    ) {
        $sibling = $collector->getModel($after);

        if (!$sibling || $relationships->isRoot($sibling)) {
            $relationships->setRoot($model);
            return;
        }

        $parent = $collector->searchParentOf($sibling);
        $relationships->setParent($model, $parent);
    }
private function handleAfter(
        ModelId $after,
        RelationshipManager $relationships,
        ModelCollector $collector,
        ModelInterface $model
    ) {
        $sibling = $collector->getModel($after);

        if (!$sibling || $relationships->isRoot($sibling)) {
            $relationships->setRoot($model);
            return;
        }

        $parent = $collector->searchParentOf($sibling);
        $relationships->setParent($model, $parent);
    }
private function handleAfter ( ModelId $ after , RelationshipManager $ relationships , ModelCollector $ collector , ModelInterface $ model ) { $ sibling = $ collector -> getModel ( $ after ) ; if ( ! $ sibling || $ relationships -> isRoot ( $ sibling ) ) { $ relationships -> setRoot ( $ model ) ; return ; } $ parent = $ collector -> searchParentOf ( $ sibling ) ; $ relationships -> setParent ( $ model , $ parent ) ; }
Handle paste after.

@param ModelId             $after         The id of the sibling model.
@param RelationshipManager $relationships The relationship manager.
@param ModelCollector      $collector     The model collector.
@param ModelInterface      $model         The model.

@return void
Handle paste after .