lib/Persistence/Doctrine/Handler/CollectionHandler.php
private function moveItemToPosition(Collection $collection, Item $item, int $newPosition): int
    {
        if (!$this->isCollectionDynamic($collection)) {
            return $this->positionHelper->moveToPosition(
                $this->getPositionHelperItemConditions(
                    $collection->id,
                    $collection->status
                ),
                $item->position,
                $newPosition
            );
        }

        return $this->incrementItemPositions($collection, $newPosition, $item->position);
    }
private function moveItemToPosition(Collection $collection, Item $item, int $newPosition): int
    {
        if (!$this->isCollectionDynamic($collection)) {
            return $this->positionHelper->moveToPosition(
                $this->getPositionHelperItemConditions(
                    $collection->id,
                    $collection->status
                ),
                $item->position,
                $newPosition
            );
        }

        return $this->incrementItemPositions($collection, $newPosition, $item->position);
    }
private function moveItemToPosition ( Collection $ collection , Item $ item , int $ newPosition ) : int { if ( ! $ this -> isCollectionDynamic ( $ collection ) ) { return $ this -> positionHelper -> moveToPosition ( $ this -> getPositionHelperItemConditions ( $ collection -> id , $ collection -> status ) , $ item -> position , $ newPosition ) ; } return $ this -> incrementItemPositions ( $ collection , $ newPosition , $ item -> position ) ; }
Moves the item to provided position.

In case of a manual collection, the case is simple, only positions between the old
and new position are ever updated.

In case of a dynamic collection, the items below the new position are incremented,
but only up until the first break in positions. The positions are never decremented.
Moves the item to provided position .