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

        if ($position === null) {
            return $nextPosition;
        }

        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 ($endPosition !== null && $endPosition < $position) {
            throw new BadStateException('position', 'When creating a position, end position needs to be greater or equal than start position.');
        }

        $this->incrementPositions(
            $conditions,
            $position,
            $endPosition
        );

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

        if ($position === null) {
            return $nextPosition;
        }

        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 ($endPosition !== null && $endPosition < $position) {
            throw new BadStateException('position', 'When creating a position, end position needs to be greater or equal than start position.');
        }

        $this->incrementPositions(
            $conditions,
            $position,
            $endPosition
        );

        return $position;
    }
public function createPosition ( array $ conditions , ? int $ position = null , ? int $ endPosition = null , bool $ allowOutOfRange = false ) : int { $ nextPosition = $ this -> getNextPosition ( $ conditions ) ; if ( $ position === null ) { return $ nextPosition ; } 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 ( $ endPosition !== null && $ endPosition < $ position ) { throw new BadStateException ( 'position' , 'When creating a position, end position needs to be greater or equal than start position.' ) ; } $ this -> incrementPositions ( $ conditions , $ position , $ endPosition ) ; return $ position ; }
Processes the database table to create space for an item which will
be inserted at specified position.

@throws \Netgen\BlockManager\Exception\BadStateException If position is out of range
Processes the database table to create space for an item which will be inserted at specified position .