CoolCMS API

TreeNodeInterface

Marker for an entity ordered as a nested set (tree via lft/rgt/level + parentId).

Acts as a switch for the generic save() (SaveTrait): the tree traits are always present on the base manager/service (so method_exists would be true for every entity), therefore the lft/rgt calculation for a new entity runs only for entities implementing this interface.

Several independent trees in one table (e.g. menu items distinguished by menuId) implement its extension ScopedTreeNodeInterface instead, which also carries the tree scope; the generic calculation reads it from the entity with no override in the manager (TreeTrait::treeConfigForEntity()).

Table of Contents

Methods

getLevel()  : int
getLft()  : int
getParentId()  : int|null
getRgt()  : int

Methods

On this page

Search results