![]() |
![]() |

Public Member Functions | |
| Node ($type, $oid=null) | |
| getNumChildren ($memOnly=true, $type=null) | |
| addChild (&$child, $addtype=ADDCHILD_BACK) | |
| updateParent (&$parent, $recursive=true) | |
| deleteChild ($childOID, $reallyDelete=false) | |
| loadChildren ($type, $buildDepth=BUILDDEPTH_SINGLE, $forceUpdate=false) | |
| & | getFirstChild ($type, $values, $properties) |
| getChildren () | |
| getChildrenEx ($oid, $type, $values, $properties) | |
| sortChildren ($criteria, $recursive=false, $changeSortkey=false, $sortFunction='') | |
| sort (&$nodeList, $criteria, $recursive=false, $changeSortkey=false, $sortFunction='') | |
| filter (&$nodeList, $oid, $type, $values, $properties) | |
| getNextSibling () | |
| getPreviousSibling () | |
| loadParents ($type, $forceUpdate=false) | |
| getNumParents ($memOnly=true, $type=null) | |
| & | getParent () |
| & | getFirstParent ($type, $values, $properties) |
| & | getParents () |
| getParentsEx ($oid, $type, $values, $properties) | |
| getDepth () | |
| getPath () | |
| acceptVisitor (&$visitor) | |
| setState ($state, $recursive=true) | |
| getDisplayValue ($useDisplayType=false) | |
| getDisplayValues ($useDisplayType=false) | |
| toString ($verbose=false) | |
Data Fields | |
| $_children = array() | |
| $_parents = array() | |
| $_depth = -1 | |
| $_path = '' | |
Definition at line 118 of file class.Node.php.
| Node | ( | $ | type, | |
| $ | oid = null | |||
| ) |
Constructor.
| type | The Nodes type. | |
| oid | The Nodes oid (, optional will be calculated if not given or not valid). |
Definition at line 130 of file class.Node.php.
References PersistentObject::PersistentObject().
Referenced by AdodbseqBase::AdodbseqBase(), LocktableBase::LocktableBase(), NMUserRoleBase::NMUserRoleBase(), Role::Role(), and User::User().

| getNumChildren | ( | $ | memOnly = true, |
|
| $ | type = null | |||
| ) |
Get the number of children of the Node.
| memOnly | True/False wether to only get the number of loaded children or all children [default: true]. | |
| type | The type of children to check (maybe null to check all children) [default: null]. |
Definition at line 140 of file class.Node.php.
References PersistenceFacade::getOIDParameter(), PersistentObject::getProperty(), and PersistentObject::getType().
Referenced by toString().

| addChild | ( | &$ | child, | |
| $ | addtype = ADDCHILD_BACK | |||
| ) |
Add a Node to the Nodes childrenlist.
| child | The Node to add. | |
| addtype | One of the ADDCHILD constants or any number >= 0 (if the number is greater than the number of children the effect is the same as ADDCHILD_BACK). |
Reimplemented in AdodbseqBase, LocktableBase, NMUserRoleBase, RoleRDBBase, and UserRDBBase.
Definition at line 166 of file class.Node.php.
References ArrayUtil::array_insert(), and WCMFException::throwEx().
Referenced by User::addRole(), and loadChildren().

| updateParent | ( | &$ | parent, | |
| $ | recursive = true | |||
| ) |
Set a given parent. Works recursively.
| parent | A reference to the Node to set the parent to. | |
| recursive | Apply function on all subsequent Nodes or not. |
Definition at line 195 of file class.Node.php.
References ArrayUtil::array_insert(), PersistentObject::getOID(), and setState().

| deleteChild | ( | $ | childOID, | |
| $ | reallyDelete = false | |||
| ) |
Delete a Node's child.
| childOID | The object id of the child Node to delete. | |
| reallyDelete | True/false [default: false]. (if reallyDelete==false mark it and it's descendants as deleted). |
Reimplemented in AdodbseqBase, LocktableBase, NMUserRoleBase, RoleRDBBase, and UserRDBBase.
Definition at line 223 of file class.Node.php.
References ArrayUtil::array_remove(), and PersistentObject::getOID().
Referenced by loadChildren(), and User::removeRole().

| loadChildren | ( | $ | type, | |
| $ | buildDepth = BUILDDEPTH_SINGLE, |
|||
| $ | forceUpdate = false | |||
| ) |
Load the children of a given type and add them. If all children should be loaded, set the type parameter to null.
| type | The type of children to load (maybe null, to load all children) | |
| buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build [default: BUILDDEPTH_SINGLE)] | |
| forceUpdate | True/False wether to reload already loaded children even if they are already loaded [default: false] |
Reimplemented in AdodbseqBase, LocktableBase, NMUserRoleBase, RoleRDBBase, and UserRDBBase.
Definition at line 255 of file class.Node.php.
References addChild(), deleteChild(), PersistenceFacade::getInstance(), PersistentObject::getOID(), PersistenceFacade::getOIDParameter(), and PersistentObject::getProperty().
Referenced by User::getRoles().

| & getFirstChild | ( | $ | type, | |
| $ | values, | |||
| $ | properties | |||
| ) |
Get the first child that matches given conditions.
| type | The type that the child should match [maybe null]. | |
| values | An assoziative array holding key value pairs that the child values should match [maybe null]. | |
| properties | An assoziative array holding key value pairs that the child properties should match [maybe null]. |
Definition at line 292 of file class.Node.php.
References getChildrenEx().

| getChildren | ( | ) |
Get the Node's children.
Definition at line 304 of file class.Node.php.
Referenced by toString().
| getChildrenEx | ( | $ | oid, | |
| $ | type, | |||
| $ | values, | |||
| $ | properties | |||
| ) |
Get the children that match given conditions.
| oid | The object id that the children should match [maybe null]. | |
| type | The type that the children should match [maybe null]. | |
| values | An assoziative array holding key value pairs that the children values should match [maybe null]. | |
| properties | An assoziative array holding key value pairs that the children properties should match [maybe null]. |
Reimplemented in AdodbseqBase, LocktableBase, NMUserRoleBase, RoleRDBBase, and UserRDBBase.
Definition at line 320 of file class.Node.php.
References filter().
Referenced by getFirstChild(), and User::getRoles().

| sortChildren | ( | $ | criteria, | |
| $ | recursive = false, |
|||
| $ | changeSortkey = false, |
|||
| $ | sortFunction = '' | |||
| ) |
Sort children by a given criteria.
| criteria | An assoziative array of criteria - SORTTYPE constant pairs OR a single criteria string. possible criteria: OID, TYPE or any value/property name (e.g. array(OID => SORTTYPE_ASC, 'sortkey' => SORTTYPE_DESC) OR 'sortkey') |
| recursive | True/False whether the descendants of the children schould be sorted too (default: false) | |
| changeSortkey | True/False whether the sortkey should be changed according to the new order (default: false) | |
| sortFunction | The name of a global compare function to use. If given criteria will be ignored (default: "") |
Definition at line 334 of file class.Node.php.
References sort().
Referenced by sort().

| sort | ( | &$ | nodeList, | |
| $ | criteria, | |||
| $ | recursive = false, |
|||
| $ | changeSortkey = false, |
|||
| $ | sortFunction = '' | |||
| ) |
Sort Node list by a given criteria.
| nodeList | A reference to an array of Nodes | |
| criteria | An assoziative array of criteria - SORTTYPE constant pairs OR a single criteria string. possible criteria: OID, TYPE or any value/property name (e.g. array(OID => SORTTYPE_ASC, 'sortkey' => SORTTYPE_DESC) OR 'sortkey') |
| recursive | True/False whether the descendants of the children schould be sorted too (default: false) | |
| changeSortkey | True/False whether the sortkey should be changed according to the new order (default: false) | |
| sortFunction | The name of a global compare function to use. If given criteria will be ignored (default: "") |
Definition at line 351 of file class.Node.php.
References $g_sortCriteria, and sortChildren().
Referenced by NodeUtil::setSortProperties(), SortController::sortAll(), and sortChildren().

| filter | ( | &$ | nodeList, | |
| $ | oid, | |||
| $ | type, | |||
| $ | values, | |||
| $ | properties | |||
| ) |
Get Nodes that match given conditions from a list.
| nodeList | An reference to an array of nodes to filter. | |
| oid | The object id that the Nodes should match [maybe null]. | |
| type | The type that the Nodes should match [maybe null]. | |
| values | An assoziative array holding key value pairs that the Node values should match [values are interpreted as regular expression, parameter maybe null]. | |
| properties | An assoziative array holding key value pairs that the Node properties should match [values are interpreted as regular expression, parameter maybe null]. |
Definition at line 395 of file class.Node.php.
References StringUtil::getDump(), WCMFException::getStackTrace(), and Log::warn().
Referenced by getChildrenEx(), UserRDBBase::getChildrenEx(), RoleRDBBase::getChildrenEx(), and getParentsEx().

| getNextSibling | ( | ) |
Get the next sibling of the Node.
Definition at line 447 of file class.Node.php.
References PersistentObject::getOID(), and getParent().

| getPreviousSibling | ( | ) |
Get the previous sibling of the Node.
Definition at line 471 of file class.Node.php.
References PersistentObject::getOID(), and getParent().

| loadParents | ( | $ | type, | |
| $ | forceUpdate = false | |||
| ) |
Load the parents of a given type and add them. If all parents should be loaded, set the type parameter to null.
| type | The type of parents to load (maybe null, to load all children) | |
| forceUpdate | True/False wether to reload already loaded parents even if they are already loaded [default: false] |
Definition at line 498 of file class.Node.php.
References PersistenceFacade::getInstance(), PersistentObject::getOID(), PersistenceFacade::getOIDParameter(), getParentsEx(), and PersistentObject::getProperty().

| getNumParents | ( | $ | memOnly = true, |
|
| $ | type = null | |||
| ) |
Get the number of parents of the Node.
| memOnly | True/False wether to only get the number of loaded parents or all parents [default: true]. | |
| type | The type of parents to check (maybe null to check all parents) [default: null]. |
Definition at line 538 of file class.Node.php.
References PersistenceFacade::getOIDParameter(), PersistentObject::getProperty(), and PersistentObject::getType().
Referenced by toString().

| & getParent | ( | ) |
Get the Nodes parent. This method exists for compatibility with previous versions. It returns the first parent.
Definition at line 563 of file class.Node.php.
Referenced by getDepth(), getNextSibling(), getPath(), and getPreviousSibling().
| & getFirstParent | ( | $ | type, | |
| $ | values, | |||
| $ | properties | |||
| ) |
Get the first parent that matches given conditions.
| type | The type that the parent should match [maybe null]. | |
| values | An assoziative array holding key value pairs that the parent values should match [maybe null]. | |
| properties | An assoziative array holding key value pairs that the parent properties should match [maybe null]. |
Definition at line 577 of file class.Node.php.
References getParentsEx().

| & getParents | ( | ) |
Get the Nodes parents.
Definition at line 589 of file class.Node.php.
Referenced by toString().
| getParentsEx | ( | $ | oid, | |
| $ | type, | |||
| $ | values, | |||
| $ | properties | |||
| ) |
Get the parents that match given conditions.
| oid | The object id that the parent should match [maybe null]. | |
| type | The type that the parents should match [maybe null]. | |
| values | An assoziative array holding key value pairs that the parent values should match [maybe null]. | |
| properties | An assoziative array holding key value pairs that the parent properties should match [maybe null]. |
Definition at line 605 of file class.Node.php.
References filter().
Referenced by getFirstParent(), NMUserRoleBase::getRoleRDBParents(), NMUserRoleBase::getUserRDBParents(), LocktableBase::getUserRDBParents(), and loadParents().

| getDepth | ( | ) |
Get the Nodes depth.
Definition at line 613 of file class.Node.php.
References getParent().

| getPath | ( | ) |
Get the Nodes path (to root).
Definition at line 628 of file class.Node.php.
References getParent(), and PersistentObject::getType().

| acceptVisitor | ( | &$ | visitor | ) |
Accept a Visitor. For use with the 'Visitor Pattern'.
| visitor | The Visitor. |
Definition at line 643 of file class.Node.php.
| setState | ( | $ | state, | |
| $ | recursive = true | |||
| ) |
Set the state of the node.
| state | The state to set. | |
| recursive | True/False [Default: True] |
Definition at line 652 of file class.Node.php.
Referenced by updateParent().
| getDisplayValue | ( | $ | useDisplayType = false |
) |
Output
Definition at line 668 of file class.Node.php.
References PersistentObject::getDisplayValue().

| getDisplayValues | ( | $ | useDisplayType = false |
) |
Delegates to NodeUtil::getDisplayValues
Definition at line 675 of file class.Node.php.
| toString | ( | $ | verbose = false |
) |
Get a string representation of the Node.
| verbose | True to get a verbose output [default: false] |
Reimplemented from PersistentObject.
Definition at line 684 of file class.Node.php.
References getChildren(), getNumChildren(), getNumParents(), PersistentObject::getOID(), and getParents().

| $_children = array() |
Definition at line 120 of file class.Node.php.
| $_parents = array() |
Definition at line 121 of file class.Node.php.
| $_depth = -1 |
Definition at line 122 of file class.Node.php.
| $_path = '' |
Definition at line 123 of file class.Node.php.
|
This page generated via doxygen 1.5.8 Mon Mar 30 01:58:44 2009. Copyright © 2009 wemove digital solutions GmbH. |
|