CoolCMS API

FeedParameter extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait

AbstractYes

Node of the nested-set tree describing the XML structure of a feed: the root item node is repeated per product set, nodes with `multiple=1` (such as `PARAM`) repeat their children per source value. The tree has two levels.

IMPORTANT: deliberately not an owned collection of Feed. The whole tree is deleted and re-inserted on every save (FeedManager::saveParameterTree()). The generic object-graph save cannot do it: parentId is a self-referencing scalar pointing to a sibling in the same inserted batch, so it can be computed only after the first flush assigns real auto-increment ids (persist without parentId, flush, compute parentId, second flush). Therefore the entity does not implement TreeNodeInterface (that would enable the generic TreeTrait lft/rgt calculation in save(), which does not run here), the Admin leaf does not declare a #[CollectionOf] inverse collection on Feed, and reads go through the dedicated bridge action internalActionParameterTree, not findAll(includes: ['parameters']).

parent_id, lft, rgt, order and level are plain int columns (no self-referencing association); order is a reserved SQL word, hence the backtick quoting, as in ProductCategory.

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

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

Properties

$action  : TAction|null
$feed  : TFeed|null
$id  : int|null
$level  : int
$lft  : int
$multiple  : bool
$order  : int
$parentId  : int|null
$rgt  : int
$tag  : string

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAction()  : TAction|null
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getFeed()  : TFeed|null
getId()  : int|null
getLevel()  : int
getLft()  : int
getMultiple()  : bool
getOrder()  : int
getParentId()  : int|null
getRgt()  : int
getTag()  : string
isMultiple()  : bool
isPersisted()  : bool
setAction()  : $this
setFeed()  : $this
setId()  : $this
setLevel()  : $this
setLft()  : $this
setMultiple()  : $this
setOrder()  : $this
setParentId()  : $this
setRgt()  : $this
setTag()  : $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: 'feed_parameter_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$lft

protected int $lft = 0
Attributes
#[Column]
$name: 'lft'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

$multiple

protected bool $multiple = false
Attributes
#[Column]
$name: 'multiple'
$type: 'boolean'

$parentId

protected int|null $parentId = null
Attributes
#[Column]
$name: 'parent_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

$rgt

protected int $rgt = 0
Attributes
#[Column]
$name: 'rgt'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

$tag

protected string $tag = ''
Attributes
#[Column]
$name: 'tag'
$type: 'string'
$length: 30

Methods

__construct()

public __construct([int|null $id = null ][, string $tag = '' ][, mixed $feed = null ][, int|null $parentId = null ][, int $lft = 0 ][, int $rgt = 0 ][, int $order = 0 ][, int $level = 1 ][, bool $multiple = false ][, mixed $action = null ]) : mixed
Parameters
$id : int|null = null
$tag : string = ''
$feed : mixed = null
$parentId : int|null = null
$lft : int = 0
$rgt : int = 0
$order : int = 0
$level : int = 1
$multiple : bool = false
$action : mixed = null

callInitMethods()

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

public callInitMethods() : void

getAction()

public getAction() : TAction|null
Return values
TAction|null

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>

getFeed()

public getFeed() : TFeed|null
Return values
TFeed|null

getMultiple()

public getMultiple() : bool
Return values
bool

getParentId()

public getParentId() : int|null
Return values
int|null

setAction()

public setAction(TAction|null $action) : $this
Parameters
$action : TAction|null
Return values
$this

setFeed()

public setFeed(TFeed|null $feed) : $this
Parameters
$feed : TFeed|null
Return values
$this

setId()

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

setLevel()

public setLevel(int $level) : $this
Parameters
$level : int
Return values
$this

setLft()

public setLft(int $lft) : $this
Parameters
$lft : int
Return values
$this

setMultiple()

public setMultiple(bool $multiple) : $this
Parameters
$multiple : bool
Return values
$this

setOrder()

public setOrder(int $order) : $this
Parameters
$order : int
Return values
$this

setParentId()

public setParentId(int|null $parentId) : $this
Parameters
$parentId : int|null
Return values
$this

setRgt()

public setRgt(int $rgt) : $this
Parameters
$rgt : int
Return values
$this

setTag()

public setTag(string $tag) : $this
Parameters
$tag : string
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