lib/Core/Validator/CollectionValidator.php
public function validateCollectionCreateStruct(CollectionCreateStruct $collectionCreateStruct): void
    {
        if ($collectionCreateStruct->queryCreateStruct !== null) {
            $this->validate(
                $collectionCreateStruct->queryCreateStruct,
                [
                    new Constraints\Type(['type' => QueryCreateStruct::class]),
                ],
                'queryCreateStruct'
            );

            $this->validateQueryCreateStruct($collectionCreateStruct->queryCreateStruct);
        }

        $offsetConstraints = [
            new Constraints\NotBlank(),
            new Constraints\Type(['type' => 'int']),
        ];

        $offsetConstraints[] = $collectionCreateStruct->queryCreateStruct !== null ?
            new Constraints\GreaterThanOrEqual(['value' => 0]) :
            new Constraints\EqualTo(['value' => 0]);

        $this->validate(
            $collectionCreateStruct->offset,
            $offsetConstraints,
            'offset'
        );

        if ($collectionCreateStruct->limit !== null) {
            $this->validate(
                $collectionCreateStruct->limit,
                [
                    new Constraints\Type(['type' => 'int']),
                    new Constraints\GreaterThan(['value' => 0]),
                ],
                'limit'
            );
        }
    }
public function validateCollectionCreateStruct(CollectionCreateStruct $collectionCreateStruct): void
    {
        if ($collectionCreateStruct->queryCreateStruct !== null) {
            $this->validate(
                $collectionCreateStruct->queryCreateStruct,
                [
                    new Constraints\Type(['type' => QueryCreateStruct::class]),
                ],
                'queryCreateStruct'
            );

            $this->validateQueryCreateStruct($collectionCreateStruct->queryCreateStruct);
        }

        $offsetConstraints = [
            new Constraints\NotBlank(),
            new Constraints\Type(['type' => 'int']),
        ];

        $offsetConstraints[] = $collectionCreateStruct->queryCreateStruct !== null ?
            new Constraints\GreaterThanOrEqual(['value' => 0]) :
            new Constraints\EqualTo(['value' => 0]);

        $this->validate(
            $collectionCreateStruct->offset,
            $offsetConstraints,
            'offset'
        );

        if ($collectionCreateStruct->limit !== null) {
            $this->validate(
                $collectionCreateStruct->limit,
                [
                    new Constraints\Type(['type' => 'int']),
                    new Constraints\GreaterThan(['value' => 0]),
                ],
                'limit'
            );
        }
    }
public function validateCollectionCreateStruct ( CollectionCreateStruct $ collectionCreateStruct ) : void { if ( $ collectionCreateStruct -> queryCreateStruct !== null ) { $ this -> validate ( $ collectionCreateStruct -> queryCreateStruct , [ new Constraints \ Type ( [ 'type' => QueryCreateStruct :: class ] ) , ] , 'queryCreateStruct' ) ; $ this -> validateQueryCreateStruct ( $ collectionCreateStruct -> queryCreateStruct ) ; } $ offsetConstraints = [ new Constraints \ NotBlank ( ) , new Constraints \ Type ( [ 'type' => 'int' ] ) , ] ; $ offsetConstraints [ ] = $ collectionCreateStruct -> queryCreateStruct !== null ? new Constraints \ GreaterThanOrEqual ( [ 'value' => 0 ] ) : new Constraints \ EqualTo ( [ 'value' => 0 ] ) ; $ this -> validate ( $ collectionCreateStruct -> offset , $ offsetConstraints , 'offset' ) ; if ( $ collectionCreateStruct -> limit !== null ) { $ this -> validate ( $ collectionCreateStruct -> limit , [ new Constraints \ Type ( [ 'type' => 'int' ] ) , new Constraints \ GreaterThan ( [ 'value' => 0 ] ) , ] , 'limit' ) ; } }
Validates the provided collection create struct.

@throws \Netgen\BlockManager\Exception\Validation\ValidationException If the validation failed
Validates the provided collection create struct .