class Simulator

This class allows the storage and retrieval of the attributes of a simulator.

Properties

private BaseController|BaseAdminController $controller
private string $name
private string $label
private string $defaultView
private string $referer
private bool $dynamic
private bool $memo
private string $description
private string $dateFormat
private string $decimalPoint
private string $moneySymbol
private string $symbolPosition
private array $datas
private Profile $profiles
private array $steps
private array $sites
private array $databases
private array $datasources
private array $sources
private array $businessrules
private string $relatedInformations
private string $dependencies
private bool $error
private array $errorMessages
private bool $warning
private array $warningMessages

Methods

void
__construct(BaseController|BaseAdminController $controller)

Constructor of class Simulator

getController()

Returns the Controller Object that uses this Simulator object.

string
getName()

Returns the name of this simulator

void
setName(string $name)

Sets the name of this simulator

string
getLabel()

Returns the label of this simulator

void
setLabel(string $label)

Sets the label of this simulator

string
getReferer()

Returns the URL of the site page (main referer) that calls this simulator

void
setReferer(string $referer)

Sets the URL of the site page (main referer) that calls this simulator

string
getDefaultView()

Returns the name of the default view with which this simulator will be displayed

void
setDefaultView(string $defaultView)

Sets the name of the default view with which this simulator will be displayed

bool
isDynamic()

Returns the dynamic attribute of this simulator.

bool
getDynamic()

Returns the dynamic attribute of this simulator.

void
setDynamic(bool $dynamic)

Determines whether this simulator is dynamic (interactive) or not.

bool
isMemo()

Returns the memo attribute of this simulator. Alias of the getMemo method.

bool
hasMemo()

Returns the memo attribute of this simulator. Alias of the getMemo method.

bool
getMemo()

Returns the memo attribute of this simulator.

void
setMemo(bool $memo)

Determines whether the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use or not.

string
getDescription()

Returns the description of this simulator

void
setDescription(string $description)

Sets the description of this simulator

string
getDateFormat()

Returns the date format in the display language of this simulator

void
setDateFormat(string $dateFormat)

Sets the date format in the display language of this simulator

string
getDecimalPoint()

Returns the decimal point in the display language of this simulator

void
setDecimalPoint(string $decimalPoint)

Sets the decimal point in the display language of this simulator

string
getMoneySymbol()

Returns the currency symbol in the country of use of this simulator

void
setMoneySymbol(string $moneySymbol)

Sets the currency symbol in the country of use of this simulator

string
getSymbolPosition()

Returns the position of the currency symbol relative to the amount in the country of use of this simulator

void
setSymbolPosition(string $symbolPosition)

Sets the position of the currency symbol relative to the amount in the country of use of this simulator

array
getDatas()

Returns the list of data used by this simulator.

void
setDatas(array $datas)

Sets the list of data used by this simulator.

void
addData(Data $data)

Adds a Data object in the list of data used by this simulator.

void
removeData(int $index)

Removes a Data object from the list of data used by this simulator.

getDataById(int $id)

Retrieves a Data object by its ID

getDataByName(string $name)

Retrieves a Data object by its name

getDataGroupById(int $id)

Retrieves a DataGroup object by its ID

getDataGroupByName(string $name)

Retrieves a DataGroup object by its name

getProfiles()

Returns the profiles container used in this simulator

void
setProfiles(Profiles $profiles)

Sets the profiles container used in this simulator

array
getSteps()

Returns the list of simulation steps defined by this simulator.

void
setSteps(array $steps)

Sets the list of simulation steps defined by this simulator.

void
addStep(Step $step)

Adds a Step object in the list of steps defined by this simulator.

void
removeStep(int $index)

Removes a Step object from the list of steps defined by this simulator.

getStepById(int $id)

Retrieves a Step object by its ID

array
getSources()

Returns the list of used sources by this simulator.

void
setSources(array $sources)

Sets the list of used sources by this simulator.

void
addSource(Source $source)

Adds a Source object in the list of used sources by this simulator.

void
removeSource(int $index)

Removes a Source object from the list of used sources by this simulator.

array
getBusinessRules()

Returns the list of business rules implemented by this simulator

void
setBusinessRules(array $businessrules)

Sets the list of business rules implemented by this simulator

void
addBusinessRule(BusinessRule $businessrules)

Adds a BusinessRule object in the list of business rules implemented by this simulator

void
removeBusinessRule(int $index)

Removes a BusinessRule object from the list of business rules implemented by this simulator

getBusinessRuleById(int $id)

Retrieves a BusinessRule object by its ID

string
getRelatedInformations()

Returns the informations related to this simulator.

void
setRelatedInformations(string $relatedInformations)

Sets the informations related to this simulator.

getSiteById(int $id)

Retrieves a Site object by its ID

getDatabaseById(int $id)

Retrieves a Database object by its ID

getDatasourceById(int $id)

Retrieves a DataSource object by its ID

getDatasourceByName(string $name)

Retrieves a DataSource object by its name

getSourceById(int $id)

Retrieves a Source object by its ID

bool
isWarning()

Returns the warning attribute of this simulator

bool
getWarning()

Returns the warning attribute of this simulator

void
setWarning(bool $warning)

Determines whether an warning has been issued or not

array
getWarningMessages()

Returns the list of warning messages

void
setWarningMessages(array $warningMessages)

Sets the list list of warning messages

void
addWarningMessage(string $warningMessage)

Adds a warning message to the list of warning messages

void
removeWarningMessage(int $index)

Removes a warning message from the list of warning messages

bool
isError()

Returns the error attribute of this simulator

bool
getError()

Returns the error attribute of this simulator

void
setError(bool $error)

Determines whether an error has been detected or not

array
getErrorMessages()

Returns the list of error messages

void
setErrorMessages(array $errorMessages)

Sets the list of error messages

void
addErrorMessage(string $errorMessage)

Adds an error message to the list of error messages

void
removeErrorMessage(int $index)

Removes an error message from the list of error messages.

string
replaceIdByDataLabel(array $matches)

Returns the label (inside a HTML var) of a data item whose ID is the first element of the given array.

string
replaceByDataLabel(string $target)

Replaces, into the given text, the ID (prefixed with #) of all data by their label inside a HTML var.

loadData(SimpleXMLElement $data)

Loads into a Data object, the data item extracted from the XML file of this simulator

void
load(string $url)

Loads the XML definition file of the simulator into this Simulator object.

void
loadEntities(SimpleXMLElement $simulator, SimpleXMLElement $datasources)

Loads the entities (elements) of the XML definition files of the simulator and data sources into this Simulator object.

loadField(SimpleXMLElement $field, FieldSet $fieldsetObj)

Loads into a Field object, the field extracted from the XML file of this simulator

loadRuleAction(SimpleXMLElement $action)

Loads into a RuleAction object, the business rule action extracted from the XML file of this simulator

void
loadSources(SimpleXMLElement $sources)

Loads into Source and Parameter objects, all the used sources extracted from the XML file of this simulator

void
loadDatabases(SimpleXMLElement $databases)

Loads into Database objects, all the databases declaration extracted from DataSources.xml

loadConnector(SimpleXMLElement $connector, Connector|null $parentConnector = null)

Loads into a Connector or a Condition object, the business rule connector extracted from the XML file of this simulator

void
loadForSource(string $url)

Loads Data, DataSource, Source objects in response of the Ajax request using route path : /{simu}/Default/source

string
addDependency(array $matches)

Adds a dependency for the data item whose ID is in the first element of the given array

string
addNoteDependency(array $matches)

Adds a note (field pre-note, field post-note, footnote) dependency for the data item is in the first element of the given array

string
replaceDataIdByName(array $matches)

Returns the name surrounded by '#(' and ')' of the data item whose ID is in the first element of the given array

string
replaceIdByName(string $target)

Replaces, into the given text, the ID (prefixed with # or inside a HTML var) of all data by their name surrounded by '#(' and ')'.

string
replaceIdByDataName(array $matches)

Returns the name of the data item whose ID is in the first element of the given array

string
replaceByDataName(string $target)

Replaces, into the given text, the ID (prefixed with # or inside a HTML var) of all data by their name.

string
paragraphs(string $text)

Converts the lines of the given text into HTML paragraphs

array
fieldProperties(SimpleXMLElement $field)

Converts a field extracted from the XML file of this simulator into an associative array for encoding in JSON format.

void
toJSONData(SimpleXMLElement $data, array $sources)

Converts a data item extracted from the XML file of this simulator into an associative array for encoding in JSON format.

array
actionsData(int $ruleID, SimpleXMLElement $actions, array $dataset)

Converts into an associative array, the list of actions (the "then" part or the the "else" part) of a business rule extracted from the XML file.

string
toJSON(string $url, int $stepId)

Converts the XML definition file of this simulator to JSON for use in Javascript for the given step.

array
ruleConnector(SimpleXMLElement $pconnector)

Converts a condition connector for a business rule extracted from the XML file into an associative array.

string
cleanRichText(string $text)

Cleans the text produced with the Javascript component "bootstrap3-wysihtml5" for its registration in the XML file of definition of this simulator

void
save(string $file)

Converts this Simulator object into an XML string and saves it to a file with the provided path.

string
makeRuleActionAttributes(RuleAction $action)

Converts the properties of a RuleAction object into an XML attributes string

void
saveConnector(Connector|Condition $connector, string $indent, array $xml)

Converts a Connector or Condition object to XML strings and inserts it into an array of indented lines

string
loadFileFromCache(string $url)

Loads an XML file from the APC cache

void
loadEmptySimulator()

Loads a simulator XML definition skeleton into this Simulator object.

Details

at line 255
void __construct(BaseController|BaseAdminController $controller)

Constructor of class Simulator

Parameters

BaseController|BaseAdminController $controller The controller that uses this Simulator object

Return Value

void

at line 266
BaseController|BaseAdminController getController()

Returns the Controller Object that uses this Simulator object.

Return Value

BaseController|BaseAdminController The Controller Object that uses this Simulator object

at line 277
string getName()

Returns the name of this simulator

Return Value

string The name of this simulator

at line 289
void setName(string $name)

Sets the name of this simulator

Parameters

string $name The name of this simulator

Return Value

void

at line 300
string getLabel()

Returns the label of this simulator

Return Value

string The label of this simulator

at line 312
void setLabel(string $label)

Sets the label of this simulator

Parameters

string $label The label of this simulator

Return Value

void

at line 323
string getReferer()

Returns the URL of the site page (main referer) that calls this simulator

Return Value

string The URL of the site page

at line 335
void setReferer(string $referer)

Sets the URL of the site page (main referer) that calls this simulator

Parameters

string $referer The URL of the site page

Return Value

void

at line 346
string getDefaultView()

Returns the name of the default view with which this simulator will be displayed

Return Value

string The name of the default view

at line 358
void setDefaultView(string $defaultView)

Sets the name of the default view with which this simulator will be displayed

Parameters

string $defaultView The name of the default view

Return Value

void

at line 369
bool isDynamic()

Returns the dynamic attribute of this simulator.

Return Value

bool true if the simulation engine will use Javascript to give interactivity to the simulation, false otherwise

at line 380
bool getDynamic()

Returns the dynamic attribute of this simulator.

Return Value

bool true if the simulation engine will use Javascript to give interactivity to the simulation, false otherwise

at line 392
void setDynamic(bool $dynamic)

Determines whether this simulator is dynamic (interactive) or not.

Parameters

bool $dynamic true if the simulation engine will use Javascript to give interactivity to the simulation, false otherwise

Return Value

void

at line 403
bool isMemo()

Returns the memo attribute of this simulator. Alias of the getMemo method.

Return Value

bool true if the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use.

at line 414
bool hasMemo()

Returns the memo attribute of this simulator. Alias of the getMemo method.

Return Value

bool true if the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use.

at line 425
bool getMemo()

Returns the memo attribute of this simulator.

Return Value

bool true if the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use.

at line 437
void setMemo(bool $memo)

Determines whether the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use or not.

Parameters

bool $memo true if the simulation engine will be allowed to save the value of certain fields in the browser cookies for later use.

Return Value

void

at line 448
string getDescription()

Returns the description of this simulator

Return Value

string The description of this simulator

at line 460
void setDescription(string $description)

Sets the description of this simulator

Parameters

string $description The description of this simulator

Return Value

void

at line 472
string getDateFormat()

Returns the date format in the display language of this simulator

Return Value

string The value of dateFormat

See also

http://php.net/manual/fr/function.date.php for the special characters that are recognized in the format

at line 485
void setDateFormat(string $dateFormat)

Sets the date format in the display language of this simulator

Parameters

string $dateFormat The date format

Return Value

void

See also

http://php.net/manual/fr/function.date.php for the special characters that are recognized in the format

at line 496
string getDecimalPoint()

Returns the decimal point in the display language of this simulator

Return Value

string The decimal point

at line 508
void setDecimalPoint(string $decimalPoint)

Sets the decimal point in the display language of this simulator

Parameters

string $decimalPoint The decimal point

Return Value

void

at line 519
string getMoneySymbol()

Returns the currency symbol in the country of use of this simulator

Return Value

string The currency symbol

at line 531
void setMoneySymbol(string $moneySymbol)

Sets the currency symbol in the country of use of this simulator

Parameters

string $moneySymbol The currency symbol

Return Value

void

at line 542
string getSymbolPosition()

Returns the position of the currency symbol relative to the amount in the country of use of this simulator

Return Value

string the value of symbolPosition

at line 554
void setSymbolPosition(string $symbolPosition)

Sets the position of the currency symbol relative to the amount in the country of use of this simulator

Parameters

string $symbolPosition

Return Value

void

at line 565
array getDatas()

Returns the list of data used by this simulator.

Return Value

array The list of data

at line 577
void setDatas(array $datas)

Sets the list of data used by this simulator.

Parameters

array $datas The list of data

Return Value

void

at line 589
void addData(Data $data)

Adds a Data object in the list of data used by this simulator.

Parameters

Data $data The Data object

Return Value

void

at line 601
void removeData(int $index)

Removes a Data object from the list of data used by this simulator.

Parameters

int $index The index of the data item in the list of data.

Return Value

void

at line 613
Data getDataById(int $id)

Retrieves a Data object by its ID

Parameters

int $id The id of the Data object

Return Value

Data The Data object

at line 634
Data getDataByName(string $name)

Retrieves a Data object by its name

Parameters

string $name The name of the Data object

Return Value

Data The Data object

at line 655
DataGroup getDataGroupById(int $id)

Retrieves a DataGroup object by its ID

Parameters

int $id The id of the DataGroup object

Return Value

DataGroup The DataGroup object

at line 672
DataGroup getDataGroupByName(string $name)

Retrieves a DataGroup object by its name

Parameters

string $name The name of the DataGroup object

Return Value

DataGroup The DataGroup object

at line 688
Profiles getProfiles()

Returns the profiles container used in this simulator

Return Value

Profiles The profiles container

at line 700
void setProfiles(Profiles $profiles)

Sets the profiles container used in this simulator

Parameters

Profiles $profiles The profiles container

Return Value

void

at line 711
array getSteps()

Returns the list of simulation steps defined by this simulator.

Return Value

array The list of simulation steps.

at line 723
void setSteps(array $steps)

Sets the list of simulation steps defined by this simulator.

Parameters

array $steps The list of simulation steps.

Return Value

void

at line 735
void addStep(Step $step)

Adds a Step object in the list of steps defined by this simulator.

Parameters

Step $step The Step object

Return Value

void

at line 747
void removeStep(int $index)

Removes a Step object from the list of steps defined by this simulator.

Parameters

int $index The index of the step in the list of steps.

Return Value

void

at line 759
Step getStepById(int $id)

Retrieves a Step object by its ID

Parameters

int $id

Return Value

Step the value of stepById

at line 775
array getSources()

Returns the list of used sources by this simulator.

Return Value

array The list of used sources.

at line 787
void setSources(array $sources)

Sets the list of used sources by this simulator.

Parameters

array $sources The list of used sources.

Return Value

void

at line 799
void addSource(Source $source)

Adds a Source object in the list of used sources by this simulator.

Parameters

Source $source The Source object

Return Value

void

at line 811
void removeSource(int $index)

Removes a Source object from the list of used sources by this simulator.

Parameters

int $index

Return Value

void

at line 822
array getBusinessRules()

Returns the list of business rules implemented by this simulator

Return Value

array The list of business rules

at line 834
void setBusinessRules(array $businessrules)

Sets the list of business rules implemented by this simulator

Parameters

array $businessrules The list of business rules

Return Value

void

at line 846
void addBusinessRule(BusinessRule $businessrules)

Adds a BusinessRule object in the list of business rules implemented by this simulator

Parameters

BusinessRule $businessrules The BusinessRule object

Return Value

void

at line 858
void removeBusinessRule(int $index)

Removes a BusinessRule object from the list of business rules implemented by this simulator

Parameters

int $index The index of the business rule in the list of business rules.

Return Value

void

at line 870
BusinessRule getBusinessRuleById(int $id)

Retrieves a BusinessRule object by its ID

Parameters

int $id

Return Value

BusinessRule the value of businessRuleById

at line 886
string getRelatedInformations()

Returns the informations related to this simulator.

Return Value

string The informations related to this simulator

at line 898
void setRelatedInformations(string $relatedInformations)

Sets the informations related to this simulator.

Parameters

string $relatedInformations The informations related to this simulator

Return Value

void

at line 910
Site getSiteById(int $id)

Retrieves a Site object by its ID

Parameters

int $id

Return Value

Site the value of siteById

at line 927
Database getDatabaseById(int $id)

Retrieves a Database object by its ID

Parameters

int $id

Return Value

Database the value of databaseById

at line 944
DataSource getDatasourceById(int $id)

Retrieves a DataSource object by its ID

Parameters

int $id

Return Value

DataSource the value of datasourceById

at line 961
DataSource getDatasourceByName(string $name)

Retrieves a DataSource object by its name

Parameters

string $name

Return Value

DataSource the value of datasourceByName

at line 978
Source getSourceById(int $id)

Retrieves a Source object by its ID

Parameters

int $id

Return Value

Source the value of sourceById

at line 994
bool isWarning()

Returns the warning attribute of this simulator

Return Value

bool true if an warning has been issued, false otherwise

at line 1005
bool getWarning()

Returns the warning attribute of this simulator

Return Value

bool true if an warning has been issued, false otherwise

at line 1017
void setWarning(bool $warning)

Determines whether an warning has been issued or not

Parameters

bool $warning true if an warning has been issued, false otherwise

Return Value

void

at line 1028
array getWarningMessages()

Returns the list of warning messages

Return Value

array The list of warning messages

at line 1040
void setWarningMessages(array $warningMessages)

Sets the list list of warning messages

Parameters

array $warningMessages The list of warning messages

Return Value

void

at line 1052
void addWarningMessage(string $warningMessage)

Adds a warning message to the list of warning messages

Parameters

string $warningMessage The warning message

Return Value

void

at line 1066
void removeWarningMessage(int $index)

Removes a warning message from the list of warning messages

Parameters

int $index

Return Value

void

at line 1077
bool isError()

Returns the error attribute of this simulator

Return Value

bool true if an error has been detected, false otherwise

at line 1088
bool getError()

Returns the error attribute of this simulator

Return Value

bool true if an error has been detected, false otherwise

at line 1100
void setError(bool $error)

Determines whether an error has been detected or not

Parameters

bool $error true if an error has been detected, false otherwise

Return Value

void

at line 1111
array getErrorMessages()

Returns the list of error messages

Return Value

array The list of error messages

at line 1123
void setErrorMessages(array $errorMessages)

Sets the list of error messages

Parameters

array $errorMessages The list of error messages

Return Value

void

at line 1135
void addErrorMessage(string $errorMessage)

Adds an error message to the list of error messages

Parameters

string $errorMessage The error message

Return Value

void

at line 1149
void removeErrorMessage(int $index)

Removes an error message from the list of error messages.

Parameters

int $index The index of the message in the list of error messages

Return Value

void

at line 1161
private string replaceIdByDataLabel(array $matches)

Returns the label (inside a HTML var) of a data item whose ID is the first element of the given array.

Parameters

array $matches An array where the first element is the ID of the data item.

Return Value

string The label inside a HTML var

at line 1175
string replaceByDataLabel(string $target)

Replaces, into the given text, the ID (prefixed with #) of all data by their label inside a HTML var.

Parameters

string $target The initial text

Return Value

string The replaced text with data labels

at line 1191
protected Data loadData(SimpleXMLElement $data)

Loads into a Data object, the data item extracted from the XML file of this simulator

Parameters

SimpleXMLElement $data The data item in XML format

Return Value

Data The Data object

at line 1258
void load(string $url)

Loads the XML definition file of the simulator into this Simulator object.

Parameters

string $url The path of the XML definition file

Return Value

void

at line 1281
protected void loadEntities(SimpleXMLElement $simulator, SimpleXMLElement $datasources)

Loads the entities (elements) of the XML definition files of the simulator and data sources into this Simulator object.

Parameters

SimpleXMLElement $simulator The XML definition file of the simulator
SimpleXMLElement $datasources The XML definition file of the data sources

Return Value

void

at line 1516
protected Field loadField(SimpleXMLElement $field, FieldSet $fieldsetObj)

Loads into a Field object, the field extracted from the XML file of this simulator

Parameters

SimpleXMLElement $field The field in XML format
FieldSet $fieldsetObj The field set that contains this field

Return Value

Field The Field object

at line 1551
protected RuleAction loadRuleAction(SimpleXMLElement $action)

Loads into a RuleAction object, the business rule action extracted from the XML file of this simulator

Parameters

SimpleXMLElement $action The business rule action in XML format

Return Value

RuleAction The RuleAction object

at line 1582
protected void loadSources(SimpleXMLElement $sources)

Loads into Source and Parameter objects, all the used sources extracted from the XML file of this simulator

Parameters

SimpleXMLElement $sources The sources in XML format

Return Value

void

at line 1615
protected void loadDatabases(SimpleXMLElement $databases)

Loads into Database objects, all the databases declaration extracted from DataSources.xml

Parameters

SimpleXMLElement $databases The databases declaration in XML format

Return Value

void

at line 1646
protected Condition|Connector loadConnector(SimpleXMLElement $connector, Connector|null $parentConnector = null)

Loads into a Connector or a Condition object, the business rule connector extracted from the XML file of this simulator

Parameters

SimpleXMLElement $connector The business rule connector in XML format
Connector|null $parentConnector (default: null) The Connector object that contains this connector or this condition

Return Value

Condition|Connector The Connector or the Condition object

at line 1665
void loadForSource(string $url)

Loads Data, DataSource, Source objects in response of the Ajax request using route path : /{simu}/Default/source

Parameters

string $url The path of the XML definition file of this sumulator

Return Value

void

at line 1717
private string addDependency(array $matches)

Adds a dependency for the data item whose ID is in the first element of the given array

Parameters

array $matches The given array

Return Value

string The name of the data item

at line 1740
private string addNoteDependency(array $matches)

Adds a note (field pre-note, field post-note, footnote) dependency for the data item is in the first element of the given array

Parameters

array $matches

Return Value

string The name of the data surrounded by '#(' and ')'

at line 1752
private string replaceDataIdByName(array $matches)

Returns the name surrounded by '#(' and ')' of the data item whose ID is in the first element of the given array

Parameters

array $matches The given array

Return Value

string The name of the data surrounded by '#(' and ')'

at line 1765
private string replaceIdByName(string $target)

Replaces, into the given text, the ID (prefixed with # or inside a HTML var) of all data by their name surrounded by '#(' and ')'.

Parameters

string $target The initial text

Return Value

string The replaced text with data names

at line 1786
private string replaceIdByDataName(array $matches)

Returns the name of the data item whose ID is in the first element of the given array

Parameters

array $matches Tha given array

Return Value

string the name of the data item

at line 1799
private string replaceByDataName(string $target)

Replaces, into the given text, the ID (prefixed with # or inside a HTML var) of all data by their name.

Parameters

string $target The initial text

Return Value

string The replaced text with data names

at line 1815
string paragraphs(string $text)

Converts the lines of the given text into HTML paragraphs

Parameters

string $text

Return Value

string

at line 1836
private array fieldProperties(SimpleXMLElement $field)

Converts a field extracted from the XML file of this simulator into an associative array for encoding in JSON format.

Also completes the list of data dependencies

Parameters

SimpleXMLElement $field

Return Value

array

at line 1891
protected void toJSONData(SimpleXMLElement $data, array $sources)

Converts a data item extracted from the XML file of this simulator into an associative array for encoding in JSON format.

Also completes the list of sources dependencies

Parameters

SimpleXMLElement $data The data item
array $sources &$sources The list of sources dependencies

Return Value

void

at line 2003
private array actionsData(int $ruleID, SimpleXMLElement $actions, array $dataset)

Converts into an associative array, the list of actions (the "then" part or the the "else" part) of a business rule extracted from the XML file.

Also completes the list of data dependencies

Parameters

int $ruleID The ID of the rule
SimpleXMLElement $actions The list of actions
array $dataset &$dataset The list of data dependencies

Return Value

array The associative array

at line 2279
string toJSON(string $url, int $stepId)

Converts the XML definition file of this simulator to JSON for use in Javascript for the given step.

Parameters

string $url The path of the XML definition file
int $stepId (default: 0) The simulation step

Return Value

string The definition of this simulator in JSON format

at line 2583
protected array ruleConnector(SimpleXMLElement $pconnector)

Converts a condition connector for a business rule extracted from the XML file into an associative array.

Parameters

SimpleXMLElement $pconnector The connector to be convertd

Return Value

array The associative array

at line 2616
private string cleanRichText(string $text)

Cleans the text produced with the Javascript component "bootstrap3-wysihtml5" for its registration in the XML file of definition of this simulator

Parameters

string $text The text to clean

Return Value

string The cleaned text

at line 2637
void save(string $file)

Converts this Simulator object into an XML string and saves it to a file with the provided path.

Parameters

string $file The path to the saved XML document.

Return Value

void

at line 3173
private string makeRuleActionAttributes(RuleAction $action)

Converts the properties of a RuleAction object into an XML attributes string

Parameters

RuleAction $action The RuleAction object

Return Value

string The XML attributes string

at line 3239
private void saveConnector(Connector|Condition $connector, string $indent, array $xml)

Converts a Connector or Condition object to XML strings and inserts it into an array of indented lines

Parameters

Connector|Condition $connector The Connector or Condition object
string $indent The indentation spaces
array $xml &$xml array of indented lines

Return Value

void

at line 3273
private string loadFileFromCache(string $url)

Loads an XML file from the APC cache

Parameters

string $url The location of the file

Return Value

string The contents of the file

at line 3296
void loadEmptySimulator()

Loads a simulator XML definition skeleton into this Simulator object.

Used to create a new simulator.

Return Value

void