ParameterRule
extends ParameterRule
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_comcat_parameter_rules'
- #[TableAlias]
- 'parameterRule'
Table of Contents
Properties
- $action : int
- $conditionsCollection : Collection<int, ParameterRuleCondition>
- $id : int|null
- $sourcesCollection : Collection<int, ParameterRuleSource>
- $targetsCollection : Collection<int, ParameterRuleTarget>
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAction() : int
- Legacy flag (1 reveals options, 2 hides them); it no longer decides the effect, see the class comment.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getConditions() : array<int, TCondition>
- 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, TCondition>
- getId() : int|null
- getSources() : array<int, TSource>
- getSourcesCollection() : Collection<int, TSource>
- getTargets() : array<int, TTarget>
- Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.
- getTargetsCollection() : Collection<int, TTarget>
- isPersisted() : bool
- setAction() : $this
- setConditionsCollection() : $this
- setId() : $this
- setSourcesCollection() : $this
- setTargetsCollection() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$action
protected
int
$action
= self::ACTION_SHOW_SELECT_OPTIONS
Attributes
- #[Column]
- $name: 'action'
- $type: 'smallint'
$conditionsCollection
protected
Collection<int, ParameterRuleCondition>
$conditionsCollection
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Comcat\Models\Entities\ParameterRuleCondition::class
- $mappedBy: 'rule'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'parameter_rule_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$sourcesCollection
protected
Collection<int, ParameterRuleSource>
$sourcesCollection
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Comcat\Models\Entities\ParameterRuleSource::class
- $mappedBy: 'rule'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$targetsCollection
protected
Collection<int, ParameterRuleTarget>
$targetsCollection
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Comcat\Models\Entities\ParameterRuleTarget::class
- $mappedBy: 'rule'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
Methods
__construct()
public
__construct([int|null $id = null ][, int $action = self::ACTION_SHOW_SELECT_OPTIONS ]) : mixed
Parameters
- $id : int|null = null
- $action : int = self::ACTION_SHOW_SELECT_OPTIONS
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAction()
Legacy flag (1 reveals options, 2 hides them); it no longer decides the effect, see the class comment.
public
getAction() : int
Return values
intgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getConditions()
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, TCondition>
Return values
array<int, TCondition>getConditionsCollection()
public
getConditionsCollection() : Collection<int, TCondition>
Return values
Collection<int, TCondition>getId()
public
getId() : int|null
Return values
int|nullgetSources()
public
getSources() : array<int, TSource>
Return values
array<int, TSource>getSourcesCollection()
public
getSourcesCollection() : Collection<int, TSource>
Return values
Collection<int, TSource>getTargets()
Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.
public
getTargets() : array<int, TTarget>
Return values
array<int, TTarget>getTargetsCollection()
public
getTargetsCollection() : Collection<int, TTarget>
Return values
Collection<int, TTarget>isPersisted()
public
isPersisted() : bool
Return values
boolsetAction()
public
setAction(int $action) : $this
Parameters
- $action : int
Return values
$thissetConditionsCollection()
public
setConditionsCollection(Collection<int, TCondition>|array<int, TCondition> $collection) : $this
Parameters
- $collection : Collection<int, TCondition>|array<int, TCondition>
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetSourcesCollection()
public
setSourcesCollection(Collection<int, TSource>|array<int, TSource> $collection) : $this
Parameters
- $collection : Collection<int, TSource>|array<int, TSource>
Return values
$thissetTargetsCollection()
public
setTargetsCollection(Collection<int, TTarget>|array<int, TTarget> $collection) : $this
Parameters
- $collection : Collection<int, TTarget>|array<int, TTarget>
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>