\src\ReingoldTilford\Models\TreeModel.inc
\ReingoldTilford\Models\TreeModel
Package: Default
Parameters
Parameters
Returns
Parameters
Returns
Parameters
Returns
Parameters
Returns
Returns
This class acts as an abstract ITreeModel implementation, implementing the most basic elements.
- Implements
- \ReingoldTilford\Models\ITreeModel
- Children
- \ReingoldTilford\Models\DomTreeModel
- \ReingoldTilford\Models\FSTreeModel
Properties
Methods
__construct(
object $root
)
:
void
This method acts as the constructor of the TreeNodeTreeModel.
Name | Type | Description |
---|---|---|
$root | object | the root of the tree |
getChild(
object $parent, int $index
)
:
object
inherited
This method returns the child at the given index of the given parent.
Inherited from: \ReingoldTilford\Models\ITreeModel::getChild()Name | Type | Description |
---|---|---|
$parent | object | the parent to get the child from |
$index | int | the index at where to search the child |
Type | Description |
---|---|
object | the child |
getChildCount(
object $parent
)
:
boolean
inherited
This method returns the number of children of the given node.
Inherited from: \ReingoldTilford\Models\ITreeModel::getChildCount()Name | Type | Description |
---|---|---|
$parent | object | the parent to get the child count from |
Type | Description |
---|---|
boolean | int the child count of the node |
getIndexOfChild(
object $parent, object $child
)
:
int
inherited
This method returns the index of the given child of the given parent.
Inherited from: \ReingoldTilford\Models\ITreeModel::getIndexOfChild()Name | Type | Description |
---|---|---|
$parent | object | the parent to search in |
$child | object | the child whose index has to be determined |
Type | Description |
---|---|
int | the index of the child |
getLabel(
\ReingoldTilford\Models\type $node
)
:
string
This method returns the label of the given node.
This default implementation return the empty string.
Name | Type | Description |
---|---|---|
$node | \ReingoldTilford\Models\type | the node for which to get the label |
Type | Description |
---|---|
string | the label of the given node |
getRoot(
)
:
object
This method returns the root of the tree.
Type | Description |
---|---|
object | the root of the tree |