CoolCMS API

ScopedTreeNodeInterface extends TreeNodeInterface

Nested-set tree where one table holds several independent trees distinguished by a scope column (e.g. menu items distinguished by `menuId`). Extends {@see TreeNodeInterface} with a scope that the entity knows about itself.

The generic lft/rgt/level calculation for a new entity in save() (SaveTrait → TreeTrait::treeConfigForEntity()) reads the scope from here, so no code has to test a concrete entity class or override treeConfigForEntity() per manager. A tree with a single numbering per table (e.g. pages) does not implement this interface and runs with an empty scope.

The scope maps property path to value; the mapper resolves it to a database column through Doctrine metadata (whitelist), so every key must be a mapped entity property.

Table of Contents

Methods

getLevel()  : int
getLft()  : int
getParentId()  : int|null
getRgt()  : int
getTreeScope()  : array<string, scalar|null>
Returns the scope of the tree the node belongs to (property path to value).

Methods

getTreeScope()

Returns the scope of the tree the node belongs to (property path to value).

public getTreeScope() : array<string, scalar|null>
Return values
array<string, scalar|null>
On this page

Search results