An API object providing methods used for building a certain Condition.
- Version:
- 15.4.5
- Source:
- See:
Members
Methods
(static) AND(arguments) → {operation/js/api/Condition}
stable API
Creates new composite Condition which consist of multiple Conditions joining them using an AND operator.
Parameters:
Name | Type | Description |
---|---|---|
arguments |
Array.<operation/js/api/Condition> | either array of Condition's or simply Condition's separated and passed one by one |
- Version:
- 15.4.5
- Source:
Returns:
Examples
// Finds all employees with firstname = 'Martin' and lastname = 'Janicek'.
var composite = Conditions.AND(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
);
// Finds all employees with firstname = 'Martin' and lastname = 'Janicek'.
var conditions = [];
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'));
conditions.push(Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek'));
var composite = Conditions.AND(conditions);
// Finds all employees whose name is either 'Martin Janicek' or 'Ondrej Brejla'
var condition = Conditions.OR(
Conditions.AND(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
),
Conditions.AND(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'),
Conditions.SIMPLE(lastName, Operator.EQUALS, 'Brejla')
)
);
(static) OR(arguments) → {operation/js/api/Condition}
stable API
Creates new composite Condition which consists of multiple Conditions joining them using an OR operator.
Parameters:
Name | Type | Description |
---|---|---|
arguments |
Array.<operation/js/api/Condition> | either array of Condition's or simply Condition's separated and passed one by one |
- Version:
- 15.4.5
- Source:
Returns:
Examples
// Finds all employees with firstname = 'Martin' or firstname = 'Ondrej'.
var composite = Conditions.OR(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej')
);
// Finds all employees with firstname = 'Martin' or firstname = 'Ondrej'.
var conditions = [];
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'));
conditions.push(Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'));
var composite = Conditions.OR(conditions);
// Finds all employees whose name is either 'Martin Janicek' or 'Ondrej Brejla'
var condition = Conditions.OR(
Conditions.AND(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin'),
Conditions.SIMPLE(lastName, Operator.EQUALS, 'Janicek')
),
Conditions.AND(
Conditions.SIMPLE(firstName, Operator.EQUALS, 'Ondrej'),
Conditions.SIMPLE(lastName, Operator.EQUALS, 'Brejla')
)
);
(static) SIMPLE(property, operator, value) → {operation/js/api/Condition}
stable API
Creates a new instance of Condition with a single restriction.
Parameters:
Name | Type | Description |
---|---|---|
property |
entity/js/api/Property | property used by this condition |
operator |
module:operation/js/api/Operator | applied operator |
value |
String |
- Version:
- 15.4.5
- Source:
Returns:
Example
var condition = Conditions.SIMPLE(firstName, Operator.EQUALS, 'Martin');