LiQuery Reference
Inherits From: NSObject
Declared In: LiCore.framework/LiQuery.h
Overview
Applicasa's LiQuery class aims to ease and enhance the need to store necessary data in a remote datastore and subsequently query it from an application with minimal fuss. To that end, LiQuery provides the standard querying interface for all application data developers store in Applicasa, along with highly customizable filtering and paging operations.
Tasks
Creating and Defining Queries
-
initWithFilter:
-
addOrderByField:SortType:
-
setGeoFilterBy:Location:Radius:
-
addPagerByPage:RecordsPerPage:
Properties
orderArray
An NSMutableArray that tells the query how to order returned items, added via addOrderByField:SortType:.
@property (nonatomic, strong) NSMutableArray *orderArray;
filters
An LiFilters object added to the query via initWithFilter:.
@property (nonatomic, strong) LiFilters *filters;
geoFilter
A location-based LiFilters object added to the query via setGeoFilterBy:Location:Radius:.
@property (nonatomic, strong) LiFilters *geoFilter;
pager
An LiPager object that tells the query how to return paginated results, added via addPagerByPage:RecordsPerPage:.
@property (nonatomic, strong) LiPager *pager;
Instance Methods
initWithFilter:
Initializes a new LiQuery object with a supplied LiFilters object for filtering results.
-
(id) initWithFilter:(LiFilters *)filter;
Parameters:
filter
An LiFilters object that defines the specific query that should be executed.
Return Value:
A reference to the initialized LiQuery instance.
addOrderByField:SortType:
Tells the query how to order and sort returned result fields.
-
(void) addOrderByField:(LiFields)field SortType:(SortType)sortType;
Parameters:
field
An LiFields enum value indicating what datastore object field should be added to the query ordering. Valid values can be found in the LiDataTypes.h downloaded SDK file.
sortType
A SortType enum value indicating what type of sorting should be performed on the added field. Valid values are Ascending and Descending.
setGeoFilterBy:Location:Radius:
Tells the query to filter results based on the provided field, location, and radius.
-
(void) setGeoFilterBy:(LiFields)field Location:(CLLocation *)location Radius:(int)radius;
Parameters:
field
An LiFields enum value indicating what datastore object field should be added to the query ordering. Valid values can be found in the LiDataTypes.h downloaded SDK file.
location
A CLLocation object indicating the location that should be used for filtering.
radius
An int value indicating the radius from location that results should be filtered by.
addPagerByPage:RecordsPerPage:
Tells the query to return paginated results, indicating which page and how many recordsPerPage should be returned.
-
(void) addPagerByPage:(NSUInteger)page RecordsPerPage:(NSUInteger)recordsPerPage;
Parameters:
page
An NSUInteger value indicating which page of results should be returned.
recordsPerPage
An NSUInteger value indicating how many records should be returned per page of results.