Since: 4.0.0

interface ImmutableNodeInterface

Interface for an immutable node class

Methods

getChildren(bool $recursive = false)

Get the children of this node

getParent()

Get the parent of this node

getRoot()

Get the root of the tree

bool
hasChildren()

Test if this node has children

bool
hasParent()

Test if this node has a parent

getSibling(bool $right = true)

Returns the right or left sibling of a node

Details

NodeInterface[] getChildren(bool $recursive = false)

Since: 4.0.0

Get the children of this node

Parameters

bool $recursive

False by default

Return Value

NodeInterface[]

The children

NodeInterface|null getParent()

Since: 4.0.0

Get the parent of this node

Return Value

NodeInterface|null

ImmutableNodeInterface getRoot()

Since: 4.0.0

Get the root of the tree

Return Value

ImmutableNodeInterface

bool hasChildren()

Since: 4.0.0

Test if this node has children

Return Value

bool

True if there is a child

bool hasParent()

Since: 4.0.0

Test if this node has a parent

Return Value

bool

True if there is a parent

NodeInterface|null getSibling(bool $right = true)

Since: 4.0.0

Returns the right or left sibling of a node

Parameters

bool $right

If set to false, returns the left sibling

Return Value

NodeInterface|null

NodeInterface object of the sibling.