CoolCMS API

ParameterRule extends BaseEntity
in package
implements ParameterRuleInterface, IdentifiableInterface uses IdentifiableTrait

AbstractYes
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'parameterRule'

Table of Contents

Interfaces

ParameterRuleInterface
Parameter rule: conditions (`conditions`) plus targets (`targets`).
IdentifiableInterface
Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).

Properties

$action  : int
$conditionsCollection  : Collection<int, ParameterRuleConditionInterface>
$id  : int|null
$sourcesCollection  : Collection<int, ParameterRuleSource>
$targetsCollection  : Collection<int, ParameterRuleTargetInterface>

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|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
getSources()  : array<int, ParameterRuleSource>
getSourcesCollection()  : Collection<int, ParameterRuleSource>
getTargets()  : array<int|string, mixed>
Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.
getTargetsCollection()  : Collection<int, ParameterRuleTargetInterface>
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'

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'parameter_rule_id'
$type: 'bigint'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

Methods

__construct()

public __construct([int|null $id = null ][, int $action = self::ACTION_SHOW_SELECT_OPTIONS ][, Collection $conditionsCollection = new ArrayCollection() ][, Collection $sourcesCollection = new ArrayCollection() ][, Collection $targetsCollection = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$action : int = self::ACTION_SHOW_SELECT_OPTIONS
$conditionsCollection : Collection = new ArrayCollection()
$sourcesCollection : Collection = new ArrayCollection()
$targetsCollection : Collection = new ArrayCollection()

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
int

getAllTraits()

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|string, mixed>
Return values
array<int|string, mixed>

getTargets()

Elements are {@see ParameterRuleTargetInterface}; for why `mixed`, see {@see self::getConditions()}.

public getTargets() : array<int|string, mixed>
Return values
array<int|string, mixed>

setAction()

public setAction(int $action) : $this
Parameters
$action : int
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results