LiFilters Reference


Inherits From: NSObject
Declared In: LiCore.framework/LiFilters.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.

Of course, building up useful queries always requires the ability to filter results to a specific set of required results. LiFilters offers the ability to define simple and complex filters that can be added to an LiQuery object to perform any kind of query applications need.


Tasks


Creating and Defining Filters

+ filterByField:Operator:Value:
+ filterByOperandA:ComplexOperator:OperandB:
+ filterByField:OrOperatorWithArrayOfValues:
- NOT


Properties


field

The LiFields enum value that will be used for filtering.

@property (nonatomic, strong) id field;

value

The value that will be used for filtering on a given field.

@property (nonatomic, strong) id value;


Class Methods


filterByField:Operator:Value:

Defines a simple filter with a given field, value, and operator.

+ (LiFilters *) filterByField:(LiFields)field Operator:(OPERATORS)op Value:(id)value;

Parameters:

field
An LiFields enum value indicating what datastore object field should be used for filtering. Valid values can be found in the LiDataTypes.h downloaded SDK file.

op
An OPERATORS enum value indicating what type of operation should be performed on the given field and value. Valid values are GreaterThan, LessThan, GreaterThanOrEqualTo, LessThanOrEqualTo, Equal, and Like.

value
An id reference to the value used to filter a given field by the provided op type.

Return Value:

An LiFilters object that can be passed to an LiQuery object or another LiFilters object for building up complex queries.

filterByOperandA:ComplexOperator:OperandB:

Defines a complex filter that accepts two LiFilters objects and an operator for combining the filters.

+ (LiFilters *) filterByOperandA:(LiFilters *)operandA ComplexOperator:(COMPLEX_OPERATORS)op OperandB:(LiFilters *)operandB;

Parameters:

operandA
An LiFilters object that will be the first part of the complex filter.

operandB
An LiFilters object that will be the second part of the complex filter.

op
A COMPLEX_OPERATORS enum value that indicates what type of operator to use in combining the filters. Valid values are AND, OR, and NOT.

Return Value:

An LiFilters object that can be passed to an LiQuery object or another LiFilters object for building up complex queries.

filterByField:OrOperatorWithArrayOfValues:

Returns an LiFilters object that will combine an acceptable array of values into an OR type of query that checks the equality of all supplied values.

+ (LiFilters *) filterByField:(LiFields)field OrOperatorWithArrayOfValues:(NSArray *)array;

Parameters:

field
An LiFields enum value indicating what datastore object field should be used for filtering. Valid values can be found in the LiDataTypes.h downloaded SDK file.

array
An NSArray of values that will be used with an OR operator to query for multiple acceptable values on a single field.

Return Value:

An LiFilters object that can be passed to an LiQuery object or another LiFilters object for building up complex queries.


Instance Methods


NOT

Modifies an LiFilters object to negate the operation being performed.

- (LiFilters *) NOT;

Return Value:

An LiFilters object that performs the ComplexOperator NOT on the already defined filter (thus, it requires that a filterByField:Operator:Value: has already been defined).


  « Back to SDK Class List