lib/Core/Validator/LayoutValidator.php
public function validateLayoutCreateStruct(LayoutCreateStruct $layoutCreateStruct): void
    {
        $layoutName = is_string($layoutCreateStruct->name) ?
            trim($layoutCreateStruct->name) :
            $layoutCreateStruct->name;

        $this->validate(
            $layoutName,
            [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => 'string']),
            ],
            'name'
        );

        if ($layoutCreateStruct->description !== null) {
            $this->validate(
                $layoutCreateStruct->description,
                [
                    new Constraints\Type(['type' => 'string']),
                ],
                'description'
            );
        }

        $this->validate(
            $layoutCreateStruct->layoutType,
            [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => LayoutTypeInterface::class]),
            ],
            'layoutType'
        );

        $this->validateLocale($layoutCreateStruct->mainLocale, 'mainLocale');

        if ($layoutCreateStruct->shared !== null) {
            $this->validate(
                $layoutCreateStruct->shared,
                [
                    new Constraints\Type(['type' => 'bool']),
                ],
                'shared'
            );
        }
    }
public function validateLayoutCreateStruct(LayoutCreateStruct $layoutCreateStruct): void
    {
        $layoutName = is_string($layoutCreateStruct->name) ?
            trim($layoutCreateStruct->name) :
            $layoutCreateStruct->name;

        $this->validate(
            $layoutName,
            [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => 'string']),
            ],
            'name'
        );

        if ($layoutCreateStruct->description !== null) {
            $this->validate(
                $layoutCreateStruct->description,
                [
                    new Constraints\Type(['type' => 'string']),
                ],
                'description'
            );
        }

        $this->validate(
            $layoutCreateStruct->layoutType,
            [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => LayoutTypeInterface::class]),
            ],
            'layoutType'
        );

        $this->validateLocale($layoutCreateStruct->mainLocale, 'mainLocale');

        if ($layoutCreateStruct->shared !== null) {
            $this->validate(
                $layoutCreateStruct->shared,
                [
                    new Constraints\Type(['type' => 'bool']),
                ],
                'shared'
            );
        }
    }
public function validateLayoutCreateStruct ( LayoutCreateStruct $ layoutCreateStruct ) : void { $ layoutName = is_string ( $ layoutCreateStruct -> name ) ? trim ( $ layoutCreateStruct -> name ) : $ layoutCreateStruct -> name ; $ this -> validate ( $ layoutName , [ new Constraints \ NotBlank ( ) , new Constraints \ Type ( [ 'type' => 'string' ] ) , ] , 'name' ) ; if ( $ layoutCreateStruct -> description !== null ) { $ this -> validate ( $ layoutCreateStruct -> description , [ new Constraints \ Type ( [ 'type' => 'string' ] ) , ] , 'description' ) ; } $ this -> validate ( $ layoutCreateStruct -> layoutType , [ new Constraints \ NotBlank ( ) , new Constraints \ Type ( [ 'type' => LayoutTypeInterface :: class ] ) , ] , 'layoutType' ) ; $ this -> validateLocale ( $ layoutCreateStruct -> mainLocale , 'mainLocale' ) ; if ( $ layoutCreateStruct -> shared !== null ) { $ this -> validate ( $ layoutCreateStruct -> shared , [ new Constraints \ Type ( [ 'type' => 'bool' ] ) , ] , 'shared' ) ; } }
Validates the provided layout create struct.

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