ImmutableNodeTrait

Defines the trait for an Immutable Node Class.

since

4.0.0

package

Application

Methods

getChildren

Get the children of this node

getChildren(bool recursive = false) : \Joomla\CMS\Tree\NodeInterface[]
since

4.0.0

Arguments

recursive

boolFalse by default

Response

\Joomla\CMS\Tree\NodeInterface[]The children

getParent

Get the parent of this node

getParent() : \Joomla\CMS\Tree\NodeInterface|null
since

4.0.0

Response

\Joomla\CMS\Tree\NodeInterface|null

getRoot

Get the root of the tree

getRoot() : \Joomla\CMS\Tree\ImmutableNodeInterface
since

4.0.0

Response

\Joomla\CMS\Tree\ImmutableNodeInterface

getSibling

Returns the right or left sibling of a node

getSibling(bool right = true) : \Joomla\CMS\Tree\NodeInterface|null
since

4.0.0

Arguments

right

boolIf set to false, returns the left sibling

Response

\Joomla\CMS\Tree\NodeInterface|nullNodeInterface object of the sibling.

hasChildren

Test if this node has children

hasChildren() : bool
since

4.0.0

Response

boolTrue if there is a child

hasParent

Test if this node has a parent

hasParent() : bool
since

4.0.0

Response

boolTrue if there is a parent

Properties

_parent

Parent node object

since

1.6

Type(s)

NodeInterface

_children

Array of Children

since

1.6

Type(s)

NodeInterface[]

_leftSibling

Node left of this one

since

1.6

Type(s)

NodeInterface

_rightSibling

Node right of this one

since

1.6

Type(s)

NodeInterface