All Classes Namespaces Files Functions Variables Pages
StringLengthValidator Class Reference
Inheritance diagram for StringLengthValidator:
AbstractValidator ValidatorInterface

Public Member Functions

 isValid ($value)
- Public Member Functions inherited from AbstractValidator
 __construct (array $options=[])
 validate ($value)
 getOptions ()

Protected Attributes

- Protected Attributes inherited from AbstractValidator
 $acceptsEmptyValues = true
 $supportedOptions = []
 $options = []

Additional Inherited Members

- Protected Member Functions inherited from AbstractValidator
 isValid ($value)
 addError ($message, $code, array $arguments=[], $title= '')
 isEmpty ($value)
 translateErrorMessage ($translateKey, $extensionName, $arguments=[])

Detailed Description

Validator for string length.

Definition at line 22 of file StringLengthValidator.php.

Member Function Documentation

isValid (   $value)

Checks if the given value is a valid string (or can be cast to a string if an object is given) and its length is between minimum and maximum specified in the validation options.

mixed$valueThe value that should be validated

Definition at line 42 of file StringLengthValidator.php.

References AbstractValidator\addError(), and AbstractValidator\translateErrorMessage().

Member Data Documentation

Initial value:
= [
'minimum' => [0, 'Minimum length for a valid string', 'integer']

Definition at line 27 of file StringLengthValidator.php.