\src\ReingoldTilford\Models\TreeModel.inc

Show: inherited
Table of Contents

\ReingoldTilford\Models\TreeModel

Package: Default

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

Propertyprotectedobject  $root= 'null'

the root of the tree

Default valuenullDetails
Type
object

Methods

methodpublic__construct( object $root ) : void

This method acts as the constructor of the TreeNodeTreeModel.

Parameters
Name Type Description
$root object

the root of the tree

methodpublicgetChild( 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()
Parameters
Name Type Description
$parent object

the parent to get the child from

$index int

the index at where to search the child

Returns
Type Description
object the child
methodpublicgetChildCount( object $parent ) : boolean
inherited

This method returns the number of children of the given node.

Inherited from: \ReingoldTilford\Models\ITreeModel::getChildCount()
Parameters
Name Type Description
$parent object

the parent to get the child count from

Returns
Type Description
boolean int the child count of the node
methodpublicgetIndexOfChild( 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()
Parameters
Name Type Description
$parent object

the parent to search in

$child object

the child whose index has to be determined

Returns
Type Description
int the index of the child
methodpublicgetLabel( \ReingoldTilford\Models\type $node ) : string

This method returns the label of the given node.

This default implementation return the empty string.

Parameters
Name Type Description
$node \ReingoldTilford\Models\type

the node for which to get the label

Returns
Type Description
string the label of the given node
methodpublicgetRoot( ) : object

This method returns the root of the tree.

Returns
Type Description
object the root of the tree
methodpublicisLeaf( object $node ) : boolean

This method returns true if the given node is a leaf.

Parameters
Name Type Description
$node object

the node

Returns
Type Description
boolean true, if the the node is a leaf, else false
Documentation was generated by DocBlox 0.15.1.