class Connector

This class allows the storage and retrieval of the attributes of a connector

A connector is an object that combines conditions in a business rule of a simulator. A connector is a combined condition.

There are three types of connectors :

  • Connector "all": the result of the evaluation of the combined condition is true if all the conditions inside the connector are evaluated to true. This is the equivalent of Boolean "and".
  • Connector "any": the result of the evaluation of the combined condition is true if at least one of the conditions inside the connector is evaluated to true. This is the equivalent of Boolean "or".
  • Connector "not": the result of the evaluation of the combined condition is true if none of the conditions inside the connector is evaluated to true. This is the equivalent of Boolean "not".

Properties

private Simulator $simulator
private string $type
private array $conditions

Methods

void
__construct(Simulator $simulator, string $type)

Constructor of class Connector

getSimulator()

Retrieves the Simulator object that has the business rule that uses this connector

string
getType()

Retrieves the type of this connector.

void
setType(string $type)

Sets the type of this connector.

array
getConditions()

Retrieves the conditions (Condition objects) or connectors (Connector objects) inside this connector.

void
setConditions(array $conditions)

Sets the conditions (Condition objects) or connectors (Connector objects) inside this connector.

void
addCondition(Condition|Connector $condition)

Adds a Condition object or Connector object to the list of objects inside this connector.

void
removeCondition(int $index)

Removes the Condition object or Connector object from the list of objects inside this connector at the given position.

getCondition(int $index)

Retrieves the Condition object or Connector object from the list of objects inside this connector at the given position.

Details

at line 80
void __construct(Simulator $simulator, string $type)

Constructor of class Connector

Parameters

Simulator $simulator The Simulator object that has the business rule that uses this connector
string $type The type of connector among "all", "any" or "none"

Return Value

void

at line 92
Simulator getSimulator()

Retrieves the Simulator object that has the business rule that uses this connector

Return Value

Simulator The Simulator object

at line 103
string getType()

Retrieves the type of this connector.

Return Value

string The type of this connector

at line 115
void setType(string $type)

Sets the type of this connector.

Parameters

string $type The type of connector among "all", "any" or "none"

Return Value

void

at line 126
array getConditions()

Retrieves the conditions (Condition objects) or connectors (Connector objects) inside this connector.

Return Value

array The conditions or connectors inside this connector.

at line 138
void setConditions(array $conditions)

Sets the conditions (Condition objects) or connectors (Connector objects) inside this connector.

Parameters

array $conditions The conditions or connectors inside this connector.

Return Value

void

at line 150
void addCondition(Condition|Connector $condition)

Adds a Condition object or Connector object to the list of objects inside this connector.

Parameters

Condition|Connector $condition A Condition object or a Connector object

Return Value

void

at line 162
void removeCondition(int $index)

Removes the Condition object or Connector object from the list of objects inside this connector at the given position.

Parameters

int $index The position of the Condition object or the Connector object in the array.

Return Value

void

at line 176
Condition|Connector|null getCondition(int $index)

Retrieves the Condition object or Connector object from the list of objects inside this connector at the given position.

Returns null if there is no object at this position.

Parameters

int $index The position of the Condition object or the Connector object in the array.

Return Value

Condition|Connector|null The Condition object or Connector object