Class Phalcon\Mvc\Model\Validator\StringLength

This validator is only for use with Phalcon\Mvc\Collection. If you are using
Phalcon\Mvc\Model, please use the validators provided by Phalcon\Validation.

<?phpusePhalcon\Mvc\Model\Validator\StringLengthasStringLengthValidator;classSubscriptorsextends\Phalcon\Mvc\Collection{publicfunctionvalidation(){$this->validate(newStringLengthValidator(["field"=>"name_last","max"=>50,"min"=>2,"messageMaximum"=>"We don't like really long names","messageMinimum"=>"We want more than just their initials",]));if($this->validationHasFailed()===true){returnfalse;}}}