aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/QKQueryParameter.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-09-10 22:58:45 +0000
committerstuconnolly <stuart02@gmail.com>2011-09-10 22:58:45 +0000
commite4dc361f7cd4b8a5062f58548427a5f542917a7f (patch)
tree5cc5ce6961a9990cf547ccf3ba869e8890192573 /Frameworks/QueryKit/QKQueryParameter.m
parent1538a53adfea8d8238dd23d36c1207938b4d8439 (diff)
downloadsequelpro-e4dc361f7cd4b8a5062f58548427a5f542917a7f.tar.gz
sequelpro-e4dc361f7cd4b8a5062f58548427a5f542917a7f.tar.bz2
sequelpro-e4dc361f7cd4b8a5062f58548427a5f542917a7f.zip
QueryKit additions.
Diffstat (limited to 'Frameworks/QueryKit/QKQueryParameter.m')
-rw-r--r--Frameworks/QueryKit/QKQueryParameter.m19
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;