diff options
Diffstat (limited to 'Frameworks/QueryKit/QKQueryParameter.m')
-rw-r--r-- | Frameworks/QueryKit/QKQueryParameter.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Frameworks/QueryKit/QKQueryParameter.m b/Frameworks/QueryKit/QKQueryParameter.m index b070e141..d131c156 100644 --- a/Frameworks/QueryKit/QKQueryParameter.m +++ b/Frameworks/QueryKit/QKQueryParameter.m @@ -31,6 +31,7 @@ // More info at <http://code.google.com/p/sequel-pro/> #import "QKQueryParameter.h" +#import "QKQueryUtilities.h" @implementation QKQueryParameter @@ -38,6 +39,9 @@ @synthesize _operator; @synthesize _value; +#pragma mark - +#pragma mark Initialisation + + (QKQueryParameter *)queryParamWithField:(NSString *)field operator:(QKQueryOperator)op value:(id)value { return [[[QKQueryParameter alloc] initParamWithField:field operator:op value:value] autorelease]; @@ -56,6 +60,21 @@ #pragma mark - +- (NSString *)description +{ + NSMutableString *string = [NSMutableString string]; + + NSString *field = [_field stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + + [string appendString:field]; + [string appendFormat:@" %@ ", [QKQueryUtilities operatorRepresentationForType:_operator]]; + [string appendString:[_value description]]; + + return string; +} + +#pragma mark - + - (void)dealloc { if (_field) [_field release], _field = nil; |