class DefaultController extends BaseController

The actions of the DefaultController class are used to run the simulation engine for a particular simulator.

Properties

ControllersHelper $helper from BaseController
Simulator $simu from BaseController
protected Parser $parser from BaseController
protected bool $error from BaseController
protected int $recursion from BaseController
protected array $simuWidgets from BaseController
protected array $variables from BaseController
protected array $memo from BaseController
protected mixed|null $sources from BaseController
protected array $log from BaseController
protected int $script from BaseController
protected array $sequence from BaseController
protected string $path from BaseController
array $uricache from BaseController
string $databasesDir from BaseController
string $simulatorsDir from BaseController
string $publicDir from BaseController
string $viewsDir from BaseController

Methods

Response|Step|null
runStep(Request $request, array $form, string $simu, string $view, bool $test)

Run the simulation engine for a step

void
addWidget(string $widget)

Adds a widget to the list of widgets

void
widgetDeps(string $widget, array $widgets, array $availWidgets)

Adds widgets that depend on a widget in the list of widgets

Response
runFields(Request $request, string $simu, bool $test = false)

Returns the simulators attributes in JSON response format

Response
runSource(Request $request, string $simu, bool $test = false)

Returns the requested source attributes in JSON response format

string
getSimuPath(string $simu, bool $test = false)

Get the simulators directory

void
checkField(Field $field, array $form, bool $skipValidation)

Checks the given field

void
processField(Field $field, Step $step, bool $displayable)

Processes the given field for the step

void
replaceFieldNotes(Field $field)

Replaces data values in the notes of a field

string|false
evaluate(string $condition)

Evaluates a condition with the expression parser

void
evaluateDefault(Data $data)

Evaluates the default value of the given data

void
evaluateDefaults()

Evaluates the default value of all data

void
evaluateMin(Data $data)

Evaluates the minimum value of the given data

void
evaluateMax(Data $data)

Evaluates the maximum value of the given data

void
evaluateMinMax()

Evaluates the minimum and the maximum value of all data

void
processData(Data $data, int $istep)

Processes the given data for the step

void
processActions(Action $actions, int $istep)

Executes all the actions of a business rule of the step

void
processRule(BusinessRule $businessrule, int $istep)

Evaluates the conditions of a business rule an executes the suitable actions

void
processRules(int $istep)

Evaluates the conditions of all business rules an executes the suitable actions

void
processDatas(int $istep)

Processes all data for the step

Response|false
calculAction(Request $request, string $simu, string $view = null)

Entry point for the route paths begining by /{simu} excepted /admin

Response|false
tryItAction(Request $request, string $simu, string $view = null)

Entry point for the route path : /{simu}/{view}/tryIt

Response
fieldsAction(Request $request, string $simu)

Entry point for the route path : /{simu}/Default/fields

Response
fieldsTryItAction(Request $request, string $simu)

Entry point for the route path : /{simu}/tryIt/Default/fields

Response
sourceAction(Request $request, string $simu)

Entry point for the route path : /{simu}/Default/source

Response
sourceTryItAction(Request $request, string $simu)

Entry point for the route path : /{simu}/tryIt/Default/source

Response|false
runCalcul(Request $request, string $simu, string $view, bool $test = false)

function runCalcul

Response
htmlOutput(Request $request, Step $step, array $datas, string $view)

function htmlOutput

bool
pdfOutput(Request $request, Step $step, array $datas, string $view = "Default")

function pdfOutput

Details

in BaseController at line 219
protected Response|Step|null runStep(Request $request, array $form, string $simu, string $view, bool $test)

Run the simulation engine for a step

Parameters

Request $request the active request
array $form The form fields
string $simu The simulator name
string $view &$view The view name
bool $test true if it is a test from the administration module, false otherwise

Return Value

Response|Step|null

in BaseController at line 510
protected void addWidget(string $widget)

Adds a widget to the list of widgets

Parameters

string $widget The widget name

Return Value

void

in BaseController at line 526
protected void widgetDeps(string $widget, array $widgets, array $availWidgets)

Adds widgets that depend on a widget in the list of widgets

Parameters

string $widget The widget name
array $widgets &$widgets the list of widgets
array $availWidgets &$availWidgets the list of available widgets

Return Value

void

in BaseController at line 547
protected Response runFields(Request $request, string $simu, bool $test = false)

Returns the simulators attributes in JSON response format

Parameters

Request $request the active request
string $simu The simulator name
bool $test (default: false) true if it is a test from the administration module, false otherwise

Return Value

Response

in BaseController at line 568
protected Response runSource(Request $request, string $simu, bool $test = false)

Returns the requested source attributes in JSON response format

Parameters

Request $request the active request
string $simu The simulator name
bool $test (default: false) true if it is a test from the administration module, false otherwise

Return Value

Response

in BaseController at line 614
protected string getSimuPath(string $simu, bool $test = false)

Get the simulators directory

Parameters

string $simu The simulator name
bool $test (default: false) true if it is a test from the administration module, false otherwise

Return Value

string the simulators directory

in BaseController at line 642
protected void checkField(Field $field, array $form, bool $skipValidation)

Checks the given field

Parameters

Field $field
array $form The form fields
bool $skipValidation

Return Value

void

in BaseController at line 702
protected void processField(Field $field, Step $step, bool $displayable)

Processes the given field for the step

Parameters

Field $field
Step $step
bool $displayable &$displayable

Return Value

void

in BaseController at line 752
protected void replaceFieldNotes(Field $field)

Replaces data values in the notes of a field

Parameters

Field $field

Return Value

void

in BaseController at line 772
protected string|false evaluate(string $condition)

Evaluates a condition with the expression parser

Parameters

string $condition The condition to evaluate

Return Value

string|false Result of the evaluation

in BaseController at line 788
protected void evaluateDefault(Data $data)

Evaluates the default value of the given data

Parameters

Data $data

Return Value

void

in BaseController at line 807
protected void evaluateDefaults()

Evaluates the default value of all data

Return Value

void

in BaseController at line 829
protected void evaluateMin(Data $data)

Evaluates the minimum value of the given data

Parameters

Data $data

Return Value

void

in BaseController at line 851
protected void evaluateMax(Data $data)

Evaluates the maximum value of the given data

Parameters

Data $data

Return Value

void

in BaseController at line 872
protected void evaluateMinMax()

Evaluates the minimum and the maximum value of all data

Return Value

void

in BaseController at line 896
protected void processData(Data $data, int $istep)

Processes the given data for the step

Parameters

Data $data
int $istep The step number

Return Value

void

in BaseController at line 995
protected void processActions(Action $actions, int $istep)

Executes all the actions of a business rule of the step

Parameters

Action $actions Actions of the business rule
int $istep The step number

Return Value

void

in BaseController at line 1195
protected void processRule(BusinessRule $businessrule, int $istep)

Evaluates the conditions of a business rule an executes the suitable actions

Parameters

BusinessRule $businessrule The rule to be processed
int $istep The step number

Return Value

void

in BaseController at line 1214
protected void processRules(int $istep)

Evaluates the conditions of all business rules an executes the suitable actions

Parameters

int $istep The step number

Return Value

void

in BaseController at line 1230
protected void processDatas(int $istep)

Processes all data for the step

Parameters

int $istep The step number

Return Value

void

at line 72
Response|false calculAction(Request $request, string $simu, string $view = null)

Entry point for the route paths begining by /{simu} excepted /admin

These route paths are :

  • /{simu}
  • /{simu}/{view}

Parameters

Request $request The request
string $simu The simulator name
string $view (default: null) The view name

Return Value

Response|false

at line 88
Response|false tryItAction(Request $request, string $simu, string $view = null)

Entry point for the route path : /{simu}/{view}/tryIt

Parameters

Request $request The request
string $simu The simulator name
string $view (default: null) The view name

Return Value

Response|false

at line 103
Response fieldsAction(Request $request, string $simu)

Entry point for the route path : /{simu}/Default/fields

Parameters

Request $request The request
string $simu The simulator name

Return Value

Response

at line 118
Response fieldsTryItAction(Request $request, string $simu)

Entry point for the route path : /{simu}/tryIt/Default/fields

Parameters

Request $request The request
string $simu The simulator name

Return Value

Response

at line 133
Response sourceAction(Request $request, string $simu)

Entry point for the route path : /{simu}/Default/source

Parameters

Request $request The request
string $simu The simulator name

Return Value

Response

at line 148
Response sourceTryItAction(Request $request, string $simu)

Entry point for the route path : /{simu}/tryIt/Default/source

Parameters

Request $request The request
string $simu The simulator name

Return Value

Response

at line 165
protected Response|false runCalcul(Request $request, string $simu, string $view, bool $test = false)

function runCalcul

Parameters

Request $request The request
string $simu The simulator name
string $view The view name
bool $test (default: false) true if it is a test from the administration module, false otherwise

Return Value

Response|false

at line 206
protected Response htmlOutput(Request $request, Step $step, array $datas, string $view)

function htmlOutput

Parameters

Request $request The request
Step $step &$step
array $datas &$datas
string $view The view name

Return Value

Response

at line 258
protected bool pdfOutput(Request $request, Step $step, array $datas, string $view = "Default")

function pdfOutput

Parameters

Request $request The request
Step $step
array $datas
string $view (default: "Default") The view name

Return Value

bool Always false