BusinessRule
class BusinessRule
This class allows the storage and retrieval of the attributes of a business rule
Properties
private Simulator | $simulator | ||
private string | $elementId | ||
private int | $id | ||
private string | $name | ||
private string | $label | ||
private string | $conditions | ||
private Connector | $connector | ||
private array | $ifActions | ||
private array | $elseActions | ||
private TranslatorInterface|null | $translator | ||
private array | $inverseOperators |
Methods
Constructor of class BusinessRule
Returns the Simulator object that defines this BusinessRule
Returns the generated id of this business rule for the DOM element in the browser
Sets the generated id of this business rule for the DOM element in the browser
Returns the business rule ID
Sets the business rule ID
Returns the business rule name
Sets the business rule name
Returns the business rule label
Sets the business rule label
Returns the business rule conditions
Sets the business rule conditions
Returns the Connector object of this business rule
Returns the list of actions that must be executed if the conditions of this business rule are verified.
Sets the list of actions that must be executed if the conditions of this business rule are verified.
Adds an action to the list of actions that must be executed if the conditions of this business rule are verified.
Returns the list of actions that must be executed if the conditions of this business rule are NOT verified.
Sets the list of actions that must be executed if the conditions of this business rule are NOT verified.
Adds an action to the list of actions that must be executed if the conditions of this business rule are NOT verified.
Returns the conditions of this business rule in a readable format.
Returns the readable format of an operator
Transforms the array of parsed conditions of this business rule into an array of conditions in a readable format
Transforms the array of parsed conditions of this business rule into their negative forms
function optimize
function optimizeCond
Parses the conditions of this business rule in an array to be usable by the administration module.
Details
at line 152
void
__construct(Simulator $simulator, string $elementId, int $id, string $name)
Constructor of class BusinessRule
at line 167
Simulator
getSimulator()
Returns the Simulator object that defines this BusinessRule
at line 178
string
getElementId()
Returns the generated id of this business rule for the DOM element in the browser
at line 191
void
setElementId(string $elementId)
Sets the generated id of this business rule for the DOM element in the browser
at line 202
int
getId()
Returns the business rule ID
at line 214
void
setId(int $id)
Sets the business rule ID
at line 225
string
getName()
Returns the business rule name
at line 237
void
setName(string $name)
Sets the business rule name
at line 248
string
getLabel()
Returns the business rule label
at line 260
void
setLabel(string $label)
Sets the business rule label
at line 271
string
getConditions()
Returns the business rule conditions
at line 283
void
setConditions(string $conditions)
Sets the business rule conditions
at line 294
Connector
getConnector()
Returns the Connector object of this business rule
at line 306
void
setConnector(Connector $connector)
Sets the Connector object of this business rule
at line 317
array
getIfActions()
Returns the list of actions that must be executed if the conditions of this business rule are verified.
at line 329
void
setIfActions(array $ifActions)
Sets the list of actions that must be executed if the conditions of this business rule are verified.
at line 341
void
addIfAction(RuleAction $ifAction)
Adds an action to the list of actions that must be executed if the conditions of this business rule are verified.
at line 352
array
getElseActions()
Returns the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 364
void
setElseActions(array $elseActions)
Sets the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 376
void
addElseAction(RuleAction $elseAction)
Adds an action to the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 389
array
getExtendedConditions()
Returns the conditions of this business rule in a readable format.
If the business rule has no connector, the conditions are first parsed then optimized.
at line 410
array
ruleConnector(Connector|Condition $pconnector)
Transforms a connector into an array of conditions
A connector is either a Condition object or a Connector object
at line 441
protected string
getPlainOperator(string $operator, string $type)
Returns the readable format of an operator
at line 484
protected void
plainConditions(array $ruleData)
Transforms the array of parsed conditions of this business rule into an array of conditions in a readable format
at line 556
protected void
negate(array $ruleData)
Transforms the array of parsed conditions of this business rule into their negative forms
at line 586
protected void
optimize(array $ruleData)
function optimize
at line 613
protected bool
optimizeCond(array $ruleData, string $connector)
function optimizeCond
at line 640
protected array
parseConditions()
Parses the conditions of this business rule in an array to be usable by the administration module.
.