Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de l'espace de nommage Joomla\CMS\Tree

Structures de données

interface  ImmutableNodeInterface
 
interface  NodeInterface
 

Fonctions

getChildren ($recursive=false)
 
 getParent ()
 
 getRoot ()
 
 hasChildren ()
 
 hasParent ()
 
 getSibling ($right=true)
 
 setParent (NodeInterface $parent)
 
 addChild (NodeInterface $child)
 
 removeChild (NodeInterface $child)
 
 setSibling (NodeInterface $sibling, $right=true)
 

Variables

trait ImmutableNodeTrait
 
 $_children = array()
 
 $_leftSibling = null
 
 $_rightSibling = null
 
trait NodeTrait
 

Description détaillée

Joomla! Content Management System

Documentation des fonctions

◆ addChild()

Joomla\CMS\Tree\addChild ( NodeInterface  $child)

Add child to this node

If the child already has a parent, the link is unset

Paramètres
NodeInterface$childThe child to be added.
Renvoie
void
Depuis
4.0.0

Références $this, et NodeInterface\setParent().

◆ getChildren()

& Joomla\CMS\Tree\getChildren (   $recursive = false)

Get the children of this node

Paramètres
boolean$recursiveFalse by default
Renvoie
NodeInterface[] The children
Depuis
4.0.0

Références Joomla\CMS\Tree\$_children, et $items.

Référencé par CategoryNode\getNumItems().

◆ getParent()

Joomla\CMS\Tree\getParent ( )

Get the parent of this node

Renvoie
NodeInterface|null
Depuis
4.0.0

Référencé par Joomla\CMS\Tree\getRoot(), et Joomla\CMS\Tree\hasParent().

◆ getRoot()

Joomla\CMS\Tree\getRoot ( )

Get the root of the tree

Renvoie
ImmutableNodeInterface
Depuis
4.0.0

Références $root, $this, et Joomla\CMS\Tree\getParent().

◆ getSibling()

Joomla\CMS\Tree\getSibling (   $right = true)

Returns the right or left sibling of a node

Paramètres
boolean$rightIf set to false, returns the left sibling
Renvoie
NodeInterface|null NodeInterface object of the sibling.
Depuis
4.0.0

Références Joomla\CMS\Tree\$_leftSibling, et Joomla\CMS\Tree\$_rightSibling.

◆ hasChildren()

Joomla\CMS\Tree\hasChildren ( )

Test if this node has children

Renvoie
boolean True if there is a child
Depuis
4.0.0

◆ hasParent()

Joomla\CMS\Tree\hasParent ( )

Test if this node has a parent

Renvoie
boolean True if there is a parent
Depuis
4.0.0

Références Joomla\CMS\Tree\getParent(), et null.

◆ removeChild()

Joomla\CMS\Tree\removeChild ( NodeInterface  $child)

Remove a specific child

Paramètres
NodeInterface$childChild to remove
Renvoie
void
Depuis
4.0.0

Références $key.

◆ setParent()

Joomla\CMS\Tree\setParent ( NodeInterface  $parent)

Set the parent of this node

If the node already has a parent, the link is unset

Paramètres
NodeInterface | null$parentNodeInterface for the parent to be set or null
Renvoie
void
Depuis
4.0.0

Références $key, et $this.

◆ setSibling()

Joomla\CMS\Tree\setSibling ( NodeInterface  $sibling,
  $right = true 
)

Function to set the left or right sibling of a node

Paramètres
NodeInterface$siblingNodeInterface object for the sibling
boolean$rightIf set to false, the sibling is the left one
Renvoie
void
Depuis
4.0.0

Documentation des variables

◆ $_children

$_children = array()
protected

◆ $_leftSibling

$_leftSibling = null
protected

◆ $_rightSibling

$_rightSibling = null
protected

◆ ImmutableNodeTrait

trait ImmutableNodeTrait
Valeur initiale :
{
protected $_parent = null
! $readonly null
Definition: layouts/joomla/form/field/calendar.php:80

Defines the trait for an Immutable Node Class.

Depuis
4.0.0

◆ NodeTrait

trait NodeTrait
Valeur initiale :
{
trait ImmutableNodeTrait
Definition: ImmutableNodeTrait.php:22

Defines the trait for a Node Interface Trait Class.

Depuis
4.0.0