ControllersHelper
class ControllersHelper
This class implements common functions needed in G6KBundle controllers.
Properties
private BaseAdminController|BaseController | $controller | ||
private ContainerInterface | $container |
Methods
Constructor of class ControllersHelper
Populates the list of values of a data item of type choice from a data source.
Populates the list of values of a data item of type choice from a data source where columns are in the given ChoiceSource object.
Returns the formatted value of the data item where the ID is in the first element of the given array.
Replaces all data ID by their corresponding value into the given text.
Prefix with a # and returns the prefixed ID of the data item where the ID is in the first element of the given array.
Replaces all the html tag var containing the ID of a data item by # followed by the ID
Returns the list of available widgets.
Retrieves the Data object of a data item of the current simulator by its ID.
Retrieves an action node by its name in the actions tree from the supplied node
Retrieves an action field node in the given fields list for the given current option node
Retrieves an action field option node by its value in the field list of the given action node
Parses a date string to the given format and converts it to a DateTime object
Determines whether the symfony kernel is in development mode or not.
Details
at line 73
void
__construct(BaseAdminController|BaseController $controller, ContainerInterface $container)
Constructor of class ControllersHelper
at line 91
protected string|null
formatParamValue(Parameter $param)
Formats a source parameter value
at line 138
protected DataSource
getDatasource(Source $source)
Returns the data source accessed by a source query
at line 156
mixed
processSource(Source $source)
Process a source query and returns the result of that query.
at line 301
void
populateChoiceWithSource(Data $data)
Populates the list of values of a data item of type choice from a data source.
at line 325
protected void
populateChoice(Data $data, ChoiceSource $choiceSource)
Populates the list of values of a data item of type choice from a data source where columns are in the given ChoiceSource object.
at line 364
protected string
replaceVariable(array $matches)
Returns the formatted value of the data item where the ID is in the first element of the given array.
If the second element of the given array is 'L' and if the data item is a choice, the label is returned instead of the value.
at line 407
string
replaceVariables(string $target)
Replaces all data ID by their corresponding value into the given text.
at line 429
protected string
replaceVariableTag(array $matches)
Prefix with a # and returns the prefixed ID of the data item where the ID is in the first element of the given array.
at line 446
string
replaceVarTagByVariable(string $target)
Replaces all the html tag var containing the ID of a data item by # followed by the ID
at line 462
array
getWidgets()
Returns the list of available widgets.
at line 480
Data
getDataById(int $id)
Retrieves the Data object of a data item of the current simulator by its ID.
at line 493
array|null
findAction(string $name, array $fromNode)
Retrieves an action node by its name in the actions tree from the supplied node
at line 511
array|null
findActionField(array $fields, array $currentNode)
Retrieves an action field node in the given fields list for the given current option node
at line 534
array|null
findActionOption(string $name, string $value, array $node)
Retrieves an action field option node by its value in the field list of the given action node
at line 559
DateTime|null
parseDate(string $format, string $dateStr)
Parses a date string to the given format and converts it to a DateTime object
at line 578
bool
isDevelopmentEnvironment()
Determines whether the symfony kernel is in development mode or not.