lib/Core/Validator/Validator.php
public function validateIdentifier(string $identifier, ?string $propertyPath = null): void
    {
        $constraints = [
            new Constraints\NotBlank(),
            new Constraints\Regex(
                [
                    'pattern' => '/^[A-Za-z0-9_]*[A-Za-z][A-Za-z0-9_]*$/',
                ]
            ),
        ];

        $this->validate($identifier, $constraints, $propertyPath);
    }
public function validateIdentifier(string $identifier, ?string $propertyPath = null): void
    {
        $constraints = [
            new Constraints\NotBlank(),
            new Constraints\Regex(
                [
                    'pattern' => '/^[A-Za-z0-9_]*[A-Za-z][A-Za-z0-9_]*$/',
                ]
            ),
        ];

        $this->validate($identifier, $constraints, $propertyPath);
    }
public function validateIdentifier ( string $ identifier , ? string $ propertyPath = null ) : void { $ constraints = [ new Constraints \ NotBlank ( ) , new Constraints \ Regex ( [ 'pattern' => '/^[A-Za-z0-9_]*[A-Za-z][A-Za-z0-9_]*$/' , ] ) , ] ; $ this -> validate ( $ identifier , $ constraints , $ propertyPath ) ; }
Validates the provided identifier to be a string.

If $isRequired is set to false, null value is also allowed.

Use the $propertyPath to change the name of the validated property in the error message.

@throws \Netgen\BlockManager\Exception\Validation\ValidationException If the validation failed
Validates the provided identifier to be a string .