FeedParameter
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait
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
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
$action
protected
TAction|null
$action
= null
$feed
protected
TFeed|null
$feed
= null
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'feed_parameter_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$level
protected
int
$level
= 1
Attributes
- #[Column]
- $name: 'level'
- $type: 'integer'
$lft
protected
int
$lft
= 0
Attributes
- #[Column]
- $name: 'lft'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$multiple
protected
bool
$multiple
= false
Attributes
- #[Column]
- $name: 'multiple'
- $type: 'boolean'
$order
protected
int
$order
= 0
Attributes
- #[Column]
- $name: '`order`'
- $type: 'integer'
$parentId
protected
int|null
$parentId
= null
Attributes
- #[Column]
- $name: 'parent_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$rgt
protected
int
$rgt
= 0
Attributes
- #[Column]
- $name: 'rgt'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$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|nullgetAllTraits()
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|nullgetId()
public
getId() : int|null
Return values
int|nullgetLevel()
public
getLevel() : int
Return values
intgetLft()
public
getLft() : int
Return values
intgetMultiple()
public
getMultiple() : bool
Return values
boolgetOrder()
public
getOrder() : int
Return values
intgetParentId()
public
getParentId() : int|null
Return values
int|nullgetRgt()
public
getRgt() : int
Return values
intgetTag()
public
getTag() : string
Return values
stringisMultiple()
public
isMultiple() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolsetAction()
public
setAction(TAction|null $action) : $this
Parameters
- $action : TAction|null
Return values
$thissetFeed()
public
setFeed(TFeed|null $feed) : $this
Parameters
- $feed : TFeed|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetLevel()
public
setLevel(int $level) : $this
Parameters
- $level : int
Return values
$thissetLft()
public
setLft(int $lft) : $this
Parameters
- $lft : int
Return values
$thissetMultiple()
public
setMultiple(bool $multiple) : $this
Parameters
- $multiple : bool
Return values
$thissetOrder()
public
setOrder(int $order) : $this
Parameters
- $order : int
Return values
$thissetParentId()
public
setParentId(int|null $parentId) : $this
Parameters
- $parentId : int|null
Return values
$thissetRgt()
public
setRgt(int $rgt) : $this
Parameters
- $rgt : int
Return values
$thissetTag()
public
setTag(string $tag) : $this
Parameters
- $tag : string
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>