TreeManagerInterface
in
Manager of a nested-set tree entity.
The methods come from TreeTrait; the interface declares them so that the tree actions of the Api presenter (TreeTrait) call them on a verified type, not blindly on a generic manager.
Table of Contents
Methods
- deleteNode() : Result
- insertTreeNode() : Result
- moveDown() : Result
- moveSubtree() : Result
- moveSubtreeTo() : Result
- moveUp() : Result
- reorderChildren() : Result
Methods
deleteNode()
public
deleteNode(int $id[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $id : int
- $config : TreeConfig = new TreeConfig()
Return values
ResultinsertTreeNode()
public
insertTreeNode(int $id[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $id : int
- $config : TreeConfig = new TreeConfig()
Return values
ResultmoveDown()
public
moveDown(int $id[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $id : int
- $config : TreeConfig = new TreeConfig()
Return values
ResultmoveSubtree()
public
moveSubtree(int $id, int|null $newParentId[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $id : int
- $newParentId : int|null
-
null moves the subtree to the root level
- $config : TreeConfig = new TreeConfig()
Return values
ResultmoveSubtreeTo()
public
moveSubtreeTo(int $id, int|null $newParentId, int $afterId[, TreeConfig $config = new TreeConfig() ][, TreeMoveExpectation|null $expectation = null ]) : Result
Parameters
- $id : int
- $newParentId : int|null
- $afterId : int
- $config : TreeConfig = new TreeConfig()
- $expectation : TreeMoveExpectation|null = null
Return values
ResultmoveUp()
public
moveUp(int $id[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $id : int
- $config : TreeConfig = new TreeConfig()
Return values
ResultreorderChildren()
public
reorderChildren(int|null $parentId, array<int, int> $orderedIds[, TreeConfig $config = new TreeConfig() ]) : Result
Parameters
- $parentId : int|null
-
null is the root level
- $orderedIds : array<int, int>
-
ids of all children of the parent in the new order
- $config : TreeConfig = new TreeConfig()