CoolCMS API

InitTrait

Table of Contents

Properties

$parametersInitialized  : bool

Methods

buildContext()  : void
Hook: a child component fills {@see \App\Core\Form\ParameterFormContext} (currency, region, comcat items, languageId, mode). Called after parameters are loaded, so it can branch on {@see hasResolvedType()}.
hasResolvedType()  : bool
For a child component: tells whether the form contains a parameter of the given type (respecting the mode via `resolveType()`).
initParameters()  : void
loadParameterGroups()  : array<string|int, ParameterGroupInterface>
Hook: a child component returns the loaded groups for the ids in `parameterItems`.
loadParameters()  : array<string|int, ParameterFormItem>
Hook: a child component returns resolved items with per-category values (order, required, groupId). Items are the source of truth for the whole form lifecycle; entity values from {@see BaseParameter} are no longer read for these three keys.
buildParameterAndOptionList()  : void
Returns ids of the parameters that this parameterId uses (directly or through options), for lookup from rules. Options have no per-category override, so they are read straight from the Parameter entity.
indexById()  : array<int, T>
indexItemsByGroups()  : void
indexItemsById()  : array<int, ParameterFormItem>

Properties

$parametersInitialized

private bool $parametersInitialized = false

Methods

buildContext()

Hook: a child component fills {@see \App\Core\Form\ParameterFormContext} (currency, region, comcat items, languageId, mode). Called after parameters are loaded, so it can branch on {@see hasResolvedType()}.

protected abstract buildContext() : void

hasResolvedType()

For a child component: tells whether the form contains a parameter of the given type (respecting the mode via `resolveType()`).

protected hasResolvedType(int $type) : bool
Parameters
$type : int
Return values
bool

initParameters()

protected initParameters() : void

loadParameters()

Hook: a child component returns resolved items with per-category values (order, required, groupId). Items are the source of truth for the whole form lifecycle; entity values from {@see BaseParameter} are no longer read for these three keys.

protected abstract loadParameters() : array<string|int, ParameterFormItem>
Return values
array<string|int, ParameterFormItem>

buildParameterAndOptionList()

Returns ids of the parameters that this parameterId uses (directly or through options), for lookup from rules. Options have no per-category override, so they are read straight from the Parameter entity.

private buildParameterAndOptionList() : void

indexById()

private indexById(array<string|int, T> $items) : array<int, T>
Parameters
$items : array<string|int, T>
Tags
template
Return values
array<int, T>

indexItemsByGroups()

private indexItemsByGroups() : void
On this page

Search results