Methods |
public
|
getParent(): static|null
Get the parent of the object
Get the parent of the object
|
#
|
public
|
getChildren(): static[]
Get the children of the object
Get the children of the object
|
#
|
public
|
setParent(static|null $parent): static
Set or unset the parent of the object
Set or unset the parent of the object
-
$child->setParent($parent) is equivalent to
$parent->addChild($child)
-
$child->setParent(null) is equivalent to
$parent->removeChild($child)
|
#
|
public
|
addChild(static $child): static
Add a child to the object
Add a child to the object
Equivalent to $child->setParent($parent) .
|
#
|
public
|
removeChild(static $child): static
Remove a child from the object
Remove a child from the object
Equivalent to $child->setParent(null) .
|
#
|
public
|
getDepth(): int
Get the length of the path to the object's root node
Get the length of the path to the object's root node
|
#
|
public
|
countDescendants(): int
Get the number of objects descended from the object
Get the number of objects descended from the object
|
#
|