protected function checkMaxLength($entity, $schema, $entityName)
    {
        if (isset($schema->maxLength) && $schema->maxLength) {
            if (strlen($entity) > $schema->maxLength) {
                throw new ValidationException(sprintf('String too long for [%s], maximum length is [%s]', $entityName, $schema->maxLength));
            }
        }

        return $this;
    }
protected function checkMaxLength($entity, $schema, $entityName)
    {
        if (isset($schema->maxLength) && $schema->maxLength) {
            if (strlen($entity) > $schema->maxLength) {
                throw new ValidationException(sprintf('String too long for [%s], maximum length is [%s]', $entityName, $schema->maxLength));
            }
        }

        return $this;
    }
protected function checkMaxLength ( $ entity , $ schema , $ entityName ) { if ( isset ( $ schema -> maxLength ) && $ schema -> maxLength ) { if ( strlen ( $ entity ) > $ schema -> maxLength ) { throw new ValidationException ( sprintf ( 'String too long for [%s], maximum length is [%s]' , $ entityName , $ schema -> maxLength ) ) ; } } return $ this ; }
Check string maximum length

@param string $entity
@param object $schema
@param string $entityName

@return Validator
Check string maximum length