CoolCMS API

ProductSetParameterRel extends BaseEntity
in package
implements ParameterRelInterface, IdentifiableInterface uses IdentifiableTrait

AbstractYes

Parameter value on a sellable set, analogous to Bazaar `AdvertParameterRel` but with a surrogate PK (`product_set_parameter_rel_id`) instead of the composite (set, parameter).

Multi-value parameters (multiselect, checkbox list) hold several rows per (set, parameter); a composite identity would collapse them into one in the ORM identity map.

value is the value (option id for select-like types, lower bound for range), value2 is the upper bound of a range.

Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'productSetParameterRel'

Table of Contents

Interfaces

ParameterRelInterface
Link between a parameter value and a host entity (currently an advert, possibly others later).
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

$id  : int|null
$parameter  : TParameter|null
$parameterId  : int|null
$productSet  : TProductSet|null
$value  : string|null
$value2  : string|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getId()  : int|null
getParameter()  : TParameter|null
getParameterId()  : int|null
getProductSet()  : TProductSet|null
getValue()  : string|null
getValue2()  : string|null
isPersisted()  : bool
setId()  : $this
setParameter()  : $this
setParameterId()  : $this
setProductSet()  : $this
setValue()  : $this
setValue2()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$id

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

$parameterId

protected int|null $parameterId = null
Attributes
#[Column]
$name: 'cms_mod_eshop_parameters_parameter_id'
$type: 'integer'
$insertable: false
$updatable: false
$nullable: true

$value

protected string|null $value = null
Attributes
#[Column]
$name: 'value'
$type: 'text'
$nullable: true

$value2

protected string|null $value2 = null
Attributes
#[Column]
$name: 'value2'
$type: 'text'
$nullable: true

Methods

__construct()

public __construct([int|null $id = null ][, mixed $productSet = null ][, mixed $parameter = null ][, string|null $value = null ][, string|null $value2 = null ][, int|null $parameterId = null ]) : mixed
Parameters
$id : int|null = null
$productSet : mixed = null
$parameter : mixed = null
$value : string|null = null
$value2 : string|null = null
$parameterId : int|null = null

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

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>

setId()

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

setParameter()

public setParameter(TParameter|null $parameter) : $this
Parameters
$parameter : TParameter|null
Return values
$this

setParameterId()

public setParameterId(int|null $parameterId) : $this
Parameters
$parameterId : int|null
Return values
$this

setProductSet()

public setProductSet(TProductSet|null $productSet) : $this
Parameters
$productSet : TProductSet|null
Return values
$this

setValue()

public setValue(string|null $value) : $this
Parameters
$value : string|null
Return values
$this

setValue2()

public setValue2(string|null $value2) : $this
Parameters
$value2 : string|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