protected function checkPattern($entity, $schema, $entityName)
    {
        if (isset($schema->pattern) && $schema->pattern) {
            if (!preg_match($schema->pattern, $entity)) {
                throw new ValidationException(sprintf('String does not match pattern for [%s]', $entityName));
            }
        }

        return $this;
    }
protected function checkPattern($entity, $schema, $entityName)
    {
        if (isset($schema->pattern) && $schema->pattern) {
            if (!preg_match($schema->pattern, $entity)) {
                throw new ValidationException(sprintf('String does not match pattern for [%s]', $entityName));
            }
        }

        return $this;
    }
protected function checkPattern ( $ entity , $ schema , $ entityName ) { if ( isset ( $ schema -> pattern ) && $ schema -> pattern ) { if ( ! preg_match ( $ schema -> pattern , $ entity ) ) { throw new ValidationException ( sprintf ( 'String does not match pattern for [%s]' , $ entityName ) ) ; } } return $ this ; }
Check value against regex pattern

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

@return Validator
Check value against regex pattern