Class Gadget_Tree_Node

Description

Gadget_Tree_Node

  • since: 1.0

Located in /Gadget/Tree/Node.php (line 27)


	
			
Direct descendents
Class Description
Gadget_Tree_FS_Node Gadget_Tree_FS_Node
Gadget_Tree_Menu_Node Gadget_Tree_Menu_Node
Gadget_Tree_XML_Node Gadget_Tree_XML_Node
Variable Summary
array $childs
string $data
object $following
string $fullPath
array $meta
string $name
object $parent
object $preceding
string $self
Method Summary
Gadget_Tree_Node Gadget_Tree_Node (mixed $name)
mixed &addChild (mixed &$child)
void addData (mixed $data)
mixed addMeta (mixed $meta, [mixed $value = null])
mixed &addNewChild (mixed $name)
array &ancestor ()
array &ancestorOrSelf ()
array &child ()
object &childAt (int $pos)
int count ()
int depth ()
array &descendant ()
mixed &firstChild ()
array &following ()
string fullPath ([mixed $separator = '/'])
array &getChildren ()
mixed &getData ()
mixed getMeta ([mixed $meta = null])
string getName ()
object &insertChild (mixed &$newChild, mixed $pos)
object &lastChild ()
void linkFollowing (mixed &$node)
void linkPreceding (mixed &$node)
object &parent ()
int position ()
mixed &preceding ()
mixed removeChild (object &$child)
mixed replaceChild (mixed &$from, object &$to)
void resetLinks ()
object &setChild (object &$child, int $pos)
void setData (mixed $data)
void setMeta ([mixed $meta = array()])
bool setParent (mixed &$parentNode)
mixed &toArray ()
Variables
array $childs = array() (line 62)

Childs

string $data (line 41)

Data

object $following (line 69)

Following Node

string $fullPath (line 90)

Full Path

array $meta = array() (line 48)

Meta

string $name (line 34)

Name

object $parent (line 55)

Parent Node

object $preceding (line 76)

Preceding Node

string $self = __CLASS__ (line 83)

Name of Class


Redefined in descendants as:
Methods
Constructor Gadget_Tree_Node (line 97)

Gadget_Tree_Node

  • access: public
Gadget_Tree_Node Gadget_Tree_Node (mixed $name)
addChild (line 232)

Add Child

  • access: public
mixed &addChild (mixed &$child)

Redefined in descendants as:
addData (line 158)

Add Data

  • access: public
void addData (mixed $data)

Redefined in descendants as:
addMeta (line 204)

Add Meta

  • access: public
mixed addMeta (mixed $meta, [mixed $value = null])

Redefined in descendants as:
addNewChild (line 219)

Add New Child

  • access: public
mixed &addNewChild (mixed $name)

Redefined in descendants as:
ancestor (line 391)

Ancestor

Returns an array of parent nodes.

  • access: public
array &ancestor ()
ancestorOrSelf (line 405)

Ancestor or Self

Returns array of the node itself and parent nodes.

array &ancestorOrSelf ()
child (line 416)

Child

  • access: public
array &child ()
childAt (line 428)

Child At

  • access: public
object &childAt (int $pos)
  • int $pos
count (line 559)

Count

  • access: public
int count ()
depth (line 582)

Depth

  • access: public
int depth ()
descendant (line 439)

Descendant

  • access: public
array &descendant ()
descendantOrSelf (line 451)

Descendant or Self

  • access: public
array &descendantOrSelf ()
firstChild (line 548)

First Child

mixed &firstChild ()
following (line 463)

Following

  • access: public
array &following ()
followingSibling (line 478)

Following Sibling

  • access: public
array &followingSibling ()
fullPath (line 594)

Full Path

  • return: Returns the full path of the node.
  • access: public
string fullPath ([mixed $separator = '/'])

Redefined in descendants as:
getChildren (line 366)

Get Children

This returns the whole tree below this node. Use child() if you want to get the first level of children.

  • access: public
array &getChildren ()
getData (line 147)

Get Data

  • access: public
mixed &getData ()
getMeta (line 180)

Get Meta

  • access: public
mixed getMeta ([mixed $meta = null])
getName (line 108)

Get Name

  • access: public
string getName ()
insertChild (line 300)

Insert Child

  • access: public
  • todo: implement
object &insertChild (mixed &$newChild, mixed $pos)
lastChild (line 536)

Last Child

Example:

  1. if (!isset($child = &$node->lastChild()) {
  2. $child = &$node->addNewChild('one and only child');
  3. }
  4. $child->addNewChild('a new child of the last child');

object &lastChild ()
linkFollowing (line 339)

Link Following

  • access: protected
void linkFollowing (mixed &$node)
linkPreceding (line 351)

Link Preceding

  • access: protected
void linkPreceding (mixed &$node)
parent (line 489)

Parent

  • access: public
object &parent ()
position (line 570)

Position

  • access: public
int position ()
preceding (line 501)

Preceding

  • access: public
  • todo: implement
mixed &preceding ()
precedingSibling (line 516)

Preceding Sibling

  • access: public
array &precedingSibling ()
removeChild (line 316)

Remove Child

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed removeChild (object &$child)
  • object $child: The Gadget_Tree_Node object to remove.
replaceChild (line 275)

Replace Child

Replace a direct child of this node with another node. Returns PEAR_Error GADGET_TREE_E_CHILD_NOT_FOUND if there's no child at the specified position.

  • return: Returns true on success or PEAR_Error on failure.
  • access: public
mixed replaceChild (mixed &$from, object &$to)
  • mixed $from: Either int position of the child or the child to replace.
  • object $to: The Gadget_Tree_Node that should replace to other child.
resetLinks (line 119)

Reset Links

  • access: public
void resetLinks ()
setChild (line 245)

Set Child

  • access: protected
object &setChild (object &$child, int $pos)
  • object $child
  • int $pos

Redefined in descendants as:
setData (line 169)

Set Data

  • access: public
void setData (mixed $data)

Redefined in descendants as:
setMeta (line 193)

Set Meta

  • access: public
void setMeta ([mixed $meta = array()])

Redefined in descendants as:
setParent (line 133)

Set Parent

  • access: public
bool setParent (mixed &$parentNode)
toArray (line 377)

To Array

  • access: public
mixed &toArray ()

Documentation generated on Sun, 03 Jul 2005 12:45:58 +0200 by phpDocumentor 1.3.0RC3