Condition
class Condition
This class allows the storage and retrieval of the attributes of a condition
A condition is a part of the set of conditions that makes up a busines rule of a simulator. It is a true/false (Boolean) expression that consists of one predicate that are applied to data.
It may be the only condition of the set of condtions or combined with other conditions using connectors "all", "any" and "none".
A condition has the following syntax :
<operand><operator>[<arithmetic expression>]
Operand, operator and arithmetic expression are stored in instances of this class.
Properties
private Simulator | $simulator | ||
private Connector | $connector | ||
private string | $operand | ||
private string | $operator | ||
private string | $expression |
Methods
Constructor of class Condition
Retrieves the Simulator object that has the business rule that uses this condition.
Retrieves the Connector object that combines this condition with others.
Retrieves the operand part (name of a data item) of this condition.
Sets the operand part (name of a data item) of this condition.
Retrieves the operator part of this condition.
Sets the operator part of this condition.
Retrieves the arithmetic expression part of this condition.
Sets the arithmetic expression part of this condition.
Details
at line 102
void
__construct(Simulator $simulator, Connector $connector, string $operand, string $operator, string $expression)
Constructor of class Condition
at line 117
Simulator
getSimulator()
Retrieves the Simulator object that has the business rule that uses this condition.
at line 130
Connector|null
getConnector()
Retrieves the Connector object that combines this condition with others.
Returns null if this condition is not combined with others.
at line 141
string
getOperand()
Retrieves the operand part (name of a data item) of this condition.
at line 153
void
setOperand(string $operand)
Sets the operand part (name of a data item) of this condition.
at line 168
string
getOperator()
Retrieves the operator part of this condition.
The possible values are: present, blank, =, !=, <, <=, >, >=, ~, !~, isTrue or isFalse.
present, blank, isTrue and isFalse are unary operators, the others are binary operators.
at line 184
void
setOperator(string $operator)
Sets the operator part of this condition.
The possible values are: present, blank, =, !=, <, <=, >, >=, ~, !~, isTrue or isFalse.
present, blank, isTrue and isFalse are unary operators, the others are binary operators.
at line 197
string|null
getExpression()
Retrieves the arithmetic expression part of this condition.
Returns null if the operator is an unary operator.
at line 211
void
setExpression(string $expression)
Sets the arithmetic expression part of this condition.
Arithmetic expressions contain data (data id prefixed with #), constants, numeric operators, boolean operators (&& or ||), parenthesis, functions.