NodeTrait
trait NodeTrait
Defines the trait for a Node Interface Trait Class.
Traits
Defines the trait for an Immutable Node Class.
Properties
protected NodeInterface
Since: 1.6
|
$_parent | Parent node object |
from ImmutableNodeTrait |
protected NodeInterface[]
Since: 1.6
|
$_children | Array of Children |
from ImmutableNodeTrait |
protected NodeInterface
Since: 1.6
|
$_leftSibling | Node left of this one |
from ImmutableNodeTrait |
protected NodeInterface
Since: 1.6
|
$_rightSibling | Node right of this one |
from ImmutableNodeTrait |
Methods
getChildren(bool $recursive = false)
Get the children of this node
from
ImmutableNodeTrait
NodeInterface|null
getSibling(bool $right = true)
Returns the right or left sibling of a node
from
ImmutableNodeTrait
void
void
void
void
setSibling(NodeInterface $sibling, bool $right = true)
Function to set the left or right sibling of a node
Details
NodeInterface|null
getSibling(bool $right = true)
Since: 4.0.0
Returns the right or left sibling of a node
void
setParent(NodeInterface $parent)
Since: 4.0.0
Set the parent of this node
If the node already has a parent, the link is unset
void
addChild(NodeInterface $child)
Since: 4.0.0
Add child to this node
If the child already has a parent, the link is unset
void
setSibling(NodeInterface $sibling, bool $right = true)
Since: 4.0.0
Function to set the left or right sibling of a node