APQuery Class Reference
Inherits from | NSObject |
Declared in | APQuery.h |
Tasks
-
+ queryStringForEqualCondition:propertyValue:
Helper method to generate an equal to query string.
-
+ queryStringForEqualCondition:date:
Helper method to generate an equal to query string.
-
+ queryStringForLikeCondition:propertyValue:
Helper method to generate a query string for like condition.
-
+ queryStringForGreaterThanCondition:propertyValue:
Helper method to generate a greater than query string.
-
+ queryStringForLessThanCondition:propertyValue:
Helper method to generate a less than query string.
-
+ queryStringForPageSize:
Helper method to generate a query string for page size.
-
+ queryStringForPageNumber:
Helper method to generate a query string for page number.
-
+ queryStringForGeoCodeProperty:location:distance:raduis:
Helper method to generate a query string for geocode search.
-
+ queryStringForPolygonSearch:withPolygonCoordinates:
Helper method to generate a query string for polygon search.
-
+ queryStringForSearchWithOneOrMoreTags:
Helper method to generate a query string for search with tags.
-
+ queryStringForSearchWithAllTags:
Helper method to generate a query string for search with tags.
-
+ queryStringForSearchWithFreeText:
Helper method to generate a query string to search for free text.
Class Methods
queryStringForEqualCondition:date:
Helper method to generate an equal to query string.
+ (NSString *)queryStringForEqualCondition:(NSString *)propertyName date:(NSDate *)date
Parameters
- propertyName
name of the property to search for
- date
the date to equate to.
Example query would be +[APQuery queryStringForEqualCondition:@“checkinDate” date:someDate] This would return “*checkinDate == date(someDate.description)‘” which is the format Appacitive understands
Discussion
Helper method to generate an equal to query string.
Declared In
APQuery.h
queryStringForEqualCondition:propertyValue:
Helper method to generate an equal to query string.
+ (NSString *)queryStringForEqualCondition:(NSString *)propertyName propertyValue:(NSString *)propertyValue
Parameters
- propertyName
name of the property to search for.
- propertyValue
the value of the property to equate to.
Example query would be +[APQuery queryStringForEqualCondition:@“hotelName” propertyValue:@“Le Meridian”] This would return “*hotelName == ‘Le Meridian’” which is the format Appacitive understands.
Discussion
Helper method to generate an equal to query string.
Declared In
APQuery.h
queryStringForGeoCodeProperty:location:distance:raduis:
Helper method to generate a query string for geocode search.
+ (NSString *)queryStringForGeoCodeProperty:(NSString *)propertyName location:(CLLocation *)location distance:(DistanceMetric)distanceMetric raduis:(NSNumber *)radius
Parameters
- propertyName
name of the property to search for
- location
the geocode to search for
- distanceMetric
the distance either in km or miles
- radius
the radios around the location to look for
Example query would be +[APQuery queryStringForGeoCodeProperty:@“location” location:{123, 123} distance:kilometers raduis:12] This would return “*location within_circle 123,123,12” which is the format Appacitive understands.
Discussion
Helper method to generate a query string for geocode search.
Declared In
APQuery.h
queryStringForGreaterThanCondition:propertyValue:
Helper method to generate a greater than query string.
+ (NSString *)queryStringForGreaterThanCondition:(NSString *)propertyName propertyValue:(NSString *)propertyValue
Parameters
- propertyName
name of the property to search for
- propertyValue
value that the property should be greater than.
Example query would be +[APQuery queryStringForGreaterThanCondition:@“cost” propertyValue:[NSString stringWithFormat@“%d”, 123]] This would return “*cost > ‘123’” which is the format Appacitive understands
Discussion
Helper method to generate a greater than query string.
Declared In
APQuery.h
queryStringForLessThanCondition:propertyValue:
Helper method to generate a less than query string.
+ (NSString *)queryStringForLessThanCondition:(NSString *)propertyName propertyValue:(NSString *)propertyValue
Parameters
- propertyName
name of the property to search for
- propertyValue
the value the property should be less than.
Example query would be +[APQuery queryStringForLessThanCondition:@“cost” propertyValue:[NSString stringWithFormat@“%d”, 123]] This would return “*cost < ‘123’” which is the format Appacitive understands
Discussion
Helper method to generate a less than query string.
Declared In
APQuery.h
queryStringForLikeCondition:propertyValue:
Helper method to generate a query string for like condition.
+ (NSString *)queryStringForLikeCondition:(NSString *)propertyName propertyValue:(NSString *)propertyValue
Parameters
- propertyName
name of the property to search for
- propertyValue
the value of the property.
Example query would be +[APQuery queryStringForLikeCondition:@“hotelName” propertyValue:@“Le Meridian”] This would return “*hotelName like ‘Le Meridian’” which is the format Appacitive understands
Discussion
Helper method to generate a query string for like condition.
Declared In
APQuery.h
queryStringForPageNumber:
Helper method to generate a query string for page number.
+ (NSString *)queryStringForPageNumber:(NSUInteger)pageNumber
Parameters
- pageNumber
the page number to get
Example query would be [APQuery queryStringForPageNumber:123] This would return “pnum=(123)” which is the format Appacitive understands
Discussion
Helper method to generate a query string for page number.
Declared In
APQuery.h
queryStringForPageSize:
Helper method to generate a query string for page size.
+ (NSString *)queryStringForPageSize:(NSUInteger)pageSize
Parameters
- pageSize
an integer value for the page size.
Example query would be [APQuery queryStringForPageSize:2] This would return “psize=(2)” which is the format Appacitive understands
Discussion
Helper method to generate a query string for page size.
Declared In
APQuery.h
queryStringForPolygonSearch:withPolygonCoordinates:
Helper method to generate a query string for polygon search.
+ (NSString *)queryStringForPolygonSearch:(NSString *)propertyName withPolygonCoordinates:(NSArray *)coordinates
Parameters
- propertyName
name of the property to search for
- coordinates
an array of CLLocation coordinates. The array needs to have a minimum of three coordinates.
Example query would be +[APQuery queryStringForPolygonSearch:@“location” withPolygonCoordinates:coordinates] This would return “*location within_polygon {lat,long} | {lat,long} | {lat,long}” which is the format Appacitive understands.
Discussion
Helper method to generate a query string for polygon search.
Declared In
APQuery.h
queryStringForSearchWithAllTags:
Helper method to generate a query string for search with tags.
+ (NSString *)queryStringForSearchWithAllTags:(NSArray *)tags
Parameters
- tags
an array of tags to search for.
Example query would be [APQuery queryStringForSearchWithAllTags:array] This would return “tagged_with_all (‘tag1,tag2’)” where tag1 and tag2 are in array, which is the format Appacitive understands
Discussion
Helper method to generate a query string for search with tags.
Declared In
APQuery.h
queryStringForSearchWithFreeText:
Helper method to generate a query string to search for free text.
+ (NSString *)queryStringForSearchWithFreeText:(NSArray *)freeTextTokens
Discussion
Helper method to generate a query string to search for free text.
@param freeTextTokens
Declared In
APQuery.h
queryStringForSearchWithOneOrMoreTags:
Helper method to generate a query string for search with tags.
+ (NSString *)queryStringForSearchWithOneOrMoreTags:(NSArray *)tags
Parameters
- tags
an array of tags to search for.
Example query would be [APQuery queryStringForSearchWithOneOrMoreTags:array] This would return “tagged_with_one_or_more (‘tag1,tag2’)” where tag1 and tag2 are in array, which is the format Appacitive understands
Discussion
Helper method to generate a query string for search with tags.
Declared In
APQuery.h