protected function validateFieldNames(array $query) {
        foreach ($query as $field => $values) {
            if (!preg_match('/^!?[a-zA-Z0-9\-_:]+$/', $field)) {
                throw new InvalidArgumentException(sprintf('Incorrect field name: %s', $field));
            }
        }
    }