ParameterRuleInterface
in
Parameter rule: conditions (`conditions`) plus targets (`targets`).
IMPORTANT: the effect is derived from the target, not from action (see Core RulesTrait and
DependentSelectTrait):
- a target with
optionId!= null reveals select options (dependent select), - a target with
parameterId/parameterGroupId(andoptionId== null) toggles a field or group or makes it conditionally required.
The interface keeps the Core rule layer from being typed on the entities of one module. Typing it on one module's entities makes rules of other modules silently drop out: the pool stays empty and toggle, required and dependent-select rules are skipped without an error.
Table of Contents
Constants
- ACTION_HIDE : mixed = 2
- ACTION_SHOW_SELECT_OPTIONS : mixed = 1
- `action` values, common to all modules (see {@see self::getAction()}).
Methods
- getAction() : int
- Legacy flag (1 reveals options, 2 hides them); it no longer decides the effect, see the class comment.
- getConditions() : array<int|string, mixed>
- Elements are {@see ParameterRuleConditionInterface}. The type is `mixed` on purpose: module entities keep conditions in an untyped Doctrine `Collection`, so a stronger promise would be false. Only the `instanceof` guard in Core (`RulesTrait`/`DependentSelectTrait`) enforces it, so it must stay.
- getConditionsCollection() : Collection<int, ParameterRuleConditionInterface>
- getId() : int|null
- getTargets() : array<int|string, mixed>
- Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.
- getTargetsCollection() : Collection<int, ParameterRuleTargetInterface>
Constants
ACTION_HIDE
public
mixed
ACTION_HIDE
= 2
ACTION_SHOW_SELECT_OPTIONS
`action` values, common to all modules (see {@see self::getAction()}).
public
mixed
ACTION_SHOW_SELECT_OPTIONS
= 1
Methods
getAction()
Legacy flag (1 reveals options, 2 hides them); it no longer decides the effect, see the class comment.
public
getAction() : int
Return values
intgetConditions()
Elements are {@see ParameterRuleConditionInterface}. The type is `mixed` on purpose: module entities keep conditions in an untyped Doctrine `Collection`, so a stronger promise would be false. Only the `instanceof` guard in Core (`RulesTrait`/`DependentSelectTrait`) enforces it, so it must stay.
public
getConditions() : array<int|string, mixed>
Return values
array<int|string, mixed>getConditionsCollection()
public
getConditionsCollection() : Collection<int, ParameterRuleConditionInterface>
Return values
Collection<int, ParameterRuleConditionInterface>getId()
public
getId() : int|null
Return values
int|nullgetTargets()
Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.
public
getTargets() : array<int|string, mixed>
Return values
array<int|string, mixed>getTargetsCollection()
public
getTargetsCollection() : Collection<int, ParameterRuleTargetInterface>