CoolCMS API

FeedParameterRel extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait

AbstractYes

Per-product-set override of the value of one feed node: when a row exists for (parameter, productSet), the generator uses this `value` instead of the value computed by the node action.

Surrogate PK: live data contains duplicate (parameter, product set) pairs (a PARAM node with multiple=1 and its children have two rows each for the same product set), which a composite PK would collapse into one row in the ORM identity map on read.

IMPORTANT: deliberately not an owned collection of Feed or FeedParameter. It is saved by a dedicated bridge action (FeedManager::saveParameterRels()) because feedParameter and productSet must already exist: an override makes sense only over an already saved tree, not within the same batch as a new tree.

valueMode controls how the manual value (value) combines with the automatic one (computed by the node action). It lives here, not on FeedParameter, because it is decided per (parameter, product set) pair and edited in the product set's feeds tab. The semantics are in FeedXmlGenerator. The UI offers it only on root nodes; on children it is ignored (a child neither replaces nor appends, the parent creates the repetition).

For a multiple node every row of the pair carries the mode (the UI has one select, so they are all equal); the first row (lowest id) is authoritative, see FeedXmlGenerator::loadOverrides().

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

Table of Contents

Interfaces

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`).

Constants

MODE_APPEND  : string = 'append'
The manual value goes after the automatic one (text: joined by a space; `multiple`: extra nodes after).
MODE_CHANGE  : string = 'change'
The manual value replaces the automatic one (default).
MODE_NONE  : string = 'none'
The tag is not sent to the feed at all for this product set: neither the manual nor the automatic value.
MODE_PREPEND  : string = 'prepend'
The manual value goes before the automatic one (text: joined by a space; `multiple`: extra nodes before).
MODES  : array<string|int, mixed> = [self::MODE_CHANGE, self::MODE_PREPEND, self::M...

Properties

$feedParameter  : TFeedParameter|null
$id  : int|null
$productSet  : TProductSet|null
$value  : string|null
$valueMode  : string

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.
getFeedParameter()  : TFeedParameter|null
getId()  : int|null
getProductSet()  : TProductSet|null
getValue()  : string|null
getValueMode()  : string
isPersisted()  : bool
setFeedParameter()  : $this
setId()  : $this
setProductSet()  : $this
setValue()  : $this
setValueMode()  : TProductSet>
Sets the value mode; an unknown value falls back to {@see MODE_CHANGE}, because a mode must never silently change a feed.
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Constants

MODE_APPEND

The manual value goes after the automatic one (text: joined by a space; `multiple`: extra nodes after).

public string MODE_APPEND = 'append'

MODE_CHANGE

The manual value replaces the automatic one (default).

public string MODE_CHANGE = 'change'

MODE_NONE

The tag is not sent to the feed at all for this product set: neither the manual nor the automatic value.

public string MODE_NONE = 'none'

MODE_PREPEND

The manual value goes before the automatic one (text: joined by a space; `multiple`: extra nodes before).

public string MODE_PREPEND = 'prepend'

MODES

public array<string|int, mixed> MODES = [self::MODE_CHANGE, self::MODE_PREPEND, self::MODE_APPEND, self::MODE_NONE]

whitelist for the manager guard and the form select

Properties

$id

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

$value

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

$valueMode

protected string $valueMode = self::MODE_CHANGE
Attributes
#[Column]
$name: 'value_mode'
$type: 'string'
$length: 10
$options: ['default' => self::MODE_CHANGE]

Methods

__construct()

public __construct([int|null $id = null ][, mixed $feedParameter = null ][, mixed $productSet = null ][, string|null $value = null ][, string $valueMode = self::MODE_CHANGE ]) : mixed
Parameters
$id : int|null = null
$feedParameter : mixed = null
$productSet : mixed = null
$value : string|null = null
$valueMode : string = self::MODE_CHANGE

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>

getFeedParameter()

public getFeedParameter() : TFeedParameter|null
Return values
TFeedParameter|null

getProductSet()

public getProductSet() : TProductSet|null
Return values
TProductSet|null

setFeedParameter()

public setFeedParameter(TFeedParameter|null $feedParameter) : $this
Parameters
$feedParameter : TFeedParameter|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : 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

setValueMode()

Sets the value mode; an unknown value falls back to {@see MODE_CHANGE}, because a mode must never silently change a feed.

public setValueMode(string $valueMode) : TProductSet>

NOTE: @return self<...> is deliberate: a fluent setter in a generic MappedSuperclass otherwise reports missingType.generics.

Parameters
$valueMode : string
Return values
TProductSet>

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