public static function stringLength($modelType, $propertyName, $maxLength, $minLength = null, $errorMessage = null) {
        if (!self::canAnnotate($modelType)) {
            return;
        }

        if (empty($propertyName)) {
            throw new \Exception('$propertyName must not be empty.');
        }

        self::makeDataAnnotation($propertyName);

        self::$annotations[$propertyName]->stringLength = array($maxLength, $minLength, $errorMessage);
    }
public static function stringLength($modelType, $propertyName, $maxLength, $minLength = null, $errorMessage = null) {
        if (!self::canAnnotate($modelType)) {
            return;
        }

        if (empty($propertyName)) {
            throw new \Exception('$propertyName must not be empty.');
        }

        self::makeDataAnnotation($propertyName);

        self::$annotations[$propertyName]->stringLength = array($maxLength, $minLength, $errorMessage);
    }
public static function stringLength ( $ modelType , $ propertyName , $ maxLength , $ minLength = null , $ errorMessage = null ) { if ( ! self :: canAnnotate ( $ modelType ) ) { return ; } if ( empty ( $ propertyName ) ) { throw new \ Exception ( '$propertyName must not be empty.' ) ; } self :: makeDataAnnotation ( $ propertyName ) ; self :: $ annotations [ $ propertyName ] -> stringLength = array ( $ maxLength , $ minLength , $ errorMessage ) ; }
Specifies the minimum and maximum length of characters that are allowed in a data field.

@param string|object $modelType The name type of model.
@param string $propertyName The property name to check.
@param int $maxLength The maximum length of a string.
@param int $minLength The minimum length of a string.
@param string The error message.

@return void
Specifies the minimum and maximum length of characters that are allowed in a data field .