lib/Persistence/Doctrine/Helper/PositionHelper.php
public function moveToPosition(array $conditions, int $originalPosition, int $position, bool $allowOutOfRange = false): int
    {
        $nextPosition = $this->getNextPosition($conditions);

        if ($position < 0) {
            throw new BadStateException('position', 'Position cannot be negative.');
        }

        if (!$allowOutOfRange && $position >= $nextPosition) {
            throw new BadStateException('position', 'Position is out of range.');
        }

        if ($position > $originalPosition) {
            $this->decrementPositions(
                $conditions,
                $originalPosition + 1,
                $position
            );
        } elseif ($position < $originalPosition) {
            $this->incrementPositions(
                $conditions,
                $position,
                $originalPosition - 1
            );
        }

        return $position;
    }
public function moveToPosition(array $conditions, int $originalPosition, int $position, bool $allowOutOfRange = false): int
    {
        $nextPosition = $this->getNextPosition($conditions);

        if ($position < 0) {
            throw new BadStateException('position', 'Position cannot be negative.');
        }

        if (!$allowOutOfRange && $position >= $nextPosition) {
            throw new BadStateException('position', 'Position is out of range.');
        }

        if ($position > $originalPosition) {
            $this->decrementPositions(
                $conditions,
                $originalPosition + 1,
                $position
            );
        } elseif ($position < $originalPosition) {
            $this->incrementPositions(
                $conditions,
                $position,
                $originalPosition - 1
            );
        }

        return $position;
    }
public function moveToPosition ( array $ conditions , int $ originalPosition , int $ position , bool $ allowOutOfRange = false ) : int { $ nextPosition = $ this -> getNextPosition ( $ conditions ) ; if ( $ position < 0 ) { throw new BadStateException ( 'position' , 'Position cannot be negative.' ) ; } if ( ! $ allowOutOfRange && $ position >= $ nextPosition ) { throw new BadStateException ( 'position' , 'Position is out of range.' ) ; } if ( $ position > $ originalPosition ) { $ this -> decrementPositions ( $ conditions , $ originalPosition + 1 , $ position ) ; } elseif ( $ position < $ originalPosition ) { $ this -> incrementPositions ( $ conditions , $ position , $ originalPosition - 1 ) ; } return $ position ; }
Processes the database table to make space for the item which
will be moved inside the table.

@throws \Netgen\BlockManager\Exception\BadStateException If position is out of range
Processes the database table to make space for the item which will be moved inside the table .