Class DBMS_TREE

Description

ABSTRACT class DBMS_TREE to handel table tree data in an object

  • author: Peter Krebs (pk) <pitlinz@users.sourceforge.net>
  • version: $Id: DBMS_TREE.phpclass,v 1.9 2008/06/17 07:45:34 pitlinz Exp $
  • version: pk-03-10-25
  • version: pk-07-06-15 added parent class DBMS_TABLEOBJ to have some common db methods
  • project: Open CSP-Management
  • license: GNU Public License

Located in /db/DBMS_TREE.phpclass (line 34)

OCSP_OBJ
   |
   --DBMS_TABLEOBJ
      |
      --DBMS_TREE
Direct descendents
Class Description
 class CLIENT_DEP_TREE ABSTRACT class DBMS_TREE to handel table tree data in an object
 class CMS_MENU_V2 Class CMS_MENU_V2
 class CMS_MENU openCSP class CMS_MENU
 class MED_CATEGORY ABSTRACT class DBMS_TREE to handel table tree data in an object
 class PRO_GROUP_TREE Class PRO_GROUP_TREE
Variable Summary
Method Summary
 DBMS_TREE DBMS_TREE ([string $aGlobalTreeKey = ""], [boolean $debug = FALSE])
 void addNodeObjectToCache ( $aId,  &$aNode, [ $debug = FALSE])
 void filterAdd (string $key, mixed $val, [bool $debug = FALSE])
 void filterClear ()
 void filterRemoveKey (string $key, bool $debug)
 DB_CURSOR &getChildrenCursor ([ $filtered = False], [boolean $debug = False])
 array getChildrenList ([bool $debug = False], [bool $filtered = False])
 array getFilteredChildrenList ([bool $debug = FALSE])
 string getGlobalTreeKey ([boolean $debug = FALSE])
 array getIndexedTreeArr ([DBMS_TREE_NODE $startNode = NULL], [string $startIdx = ""], [string $startIntend = ""], [string $intendStr = "&nbsp;&nbsp;"], [string $nameField = ""], [boolean $debug = FALSE])
 mixed getKey (string $kName)
 array getKeyTree ()
 array getKeyTreeNode (array $dbRow, [boolean $debug = FALSE])
 DBMS_TREE_NODE &getNode (int $aId, [bool $debug = FALSE])
 array getNodeDBRowFromDB (int $aId, [boolean $debug = FALSE])
 void &getNodeObjectFromCache ( $aId, [ $debug = FALSE])
 int getRootId ()
 array getRootPath (mixed $aNode, [bool $useCache = TRUE], [bool $debug = FALSE])
 ptr &getTreeArray (bool $debug)
 DBMS_TREE_NODE &newNodeObject (int $aId, [ $dataArr = NULL], [boolean $debug = FALSE], string $aClassName)
 boolean populate ([bool $useCache = TRUE], [bool $debug = FALSE], [ $filtered = FALSE])
 DBMS_TREE_NODE &populateNode (int $aId, [bool $useCache = TRUE], [bool $debug = FALSE])
 void populateTree ([ $useCache = TRUE], [ $keysOnly = TRUE], [ $where = ""], [ $debug = FALSE])
 void setChildClassVar ( &$child, [boolean $debug = False], &DBMS_TREE_NODE $child)
 void setGlobalTreeKey (string $aKey)
 void setKey (string $kName, mixed $kValue)
 void setKeyTree (array $treeArr)
 void setRootId (int $aId)
Variables
string $childClassColumn = "" (line 72)
  • var: name of the column holding the class name of children
  • since: pk-06-07-26
  • access: protected
string $myChildClass = "DBMS_TREE_NODE" (line 66)
  • var: NOT FINAL name of the class children should have it is used in eval("new ".$myChildClass."()")
  • access: protected

Redefined in descendants as:
string $myChildKeys = "" (line 78)
  • var: NOT FINAL comma sperated list of keys the children have to fit to
  • access: protected

Redefined in descendants as:
array $myChildren = array() (line 83)
  • var: array starts at 1 !! key=sortorder
  • access: protected
doubl $myChildrenPopulateTS (line 88)
  • var: time() when childrens have been populated
  • access: protected
array $myFilterArr = NULL (line 98)
  • access: protected
string $myGlobalTreeKey = "" (line 55)
  • var: index in $OCSP_VAL['DBMS_TREE'][]
  • access: protected

Redefined in descendants as:
mixed $myIdFld = "" (line 39)
  • staticvar: string $myIdFld: NOT FINAL name column which is the parent column in childrows
  • access: protected

Redefined in descendants as:
string $myLink = "" (line 93)
  • var: link the entry
  • access: protected
mixed $myParentFld = "" (line 44)
  • staticvar: string $myParentFld: NOT FINAL name of the parent column
  • access: protected

Redefined in descendants as:
int $myRootId = 0 (line 60)
  • var: index of the root element (is not loaded)
  • access: protected
mixed $mySortFld = "" (line 49)
  • staticvar: string $mySortFld: NOT FINAL name of the sort field
  • access: protected

Redefined in descendants as:

Inherited Variables

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::$autoIncFld
DBMS_TABLEOBJ::$dbTableDefinitions
DBMS_TABLEOBJ::$frmPostSubOjects
DBMS_TABLEOBJ::$hasObjVals
DBMS_TABLEOBJ::$initTS
DBMS_TABLEOBJ::$myCacheTS
DBMS_TABLEOBJ::$myFields
DBMS_TABLEOBJ::$myKeys
DBMS_TABLEOBJ::$myLinkedTableRows
DBMS_TABLEOBJ::$myMode
DBMS_TABLEOBJ::$myObjVals
DBMS_TABLEOBJ::$myObjValsPopulateTS
DBMS_TABLEOBJ::$myTable
DBMS_TABLEOBJ::$objError
DBMS_TABLEOBJ::$objErrorMsg
DBMS_TABLEOBJ::$populateTS
DBMS_TABLEOBJ::$staticClassVars
DBMS_TABLEOBJ::$valChangeTS

Inherited from OCSP_OBJ

OCSP_OBJ::$global_currentUser
OCSP_OBJ::$global_defaultDBObj_read
OCSP_OBJ::$global_defaultDBObj_write
OCSP_OBJ::$myDBObj
Methods
Constructor DBMS_TREE (line 113)
  • since: pk-07-06-19
  • access: public
DBMS_TREE DBMS_TREE ([string $aGlobalTreeKey = ""], [boolean $debug = FALSE])
  • string $aGlobalTreeKey
  • boolean $debug
addNodeObjectToCache (line 729)
void addNodeObjectToCache ( $aId,  &$aNode, [ $debug = FALSE])
  • $aId
  • &$aNode
  • $debug
filterAdd (line 323)

adds a key value pair to $myFilterArr

  • since: pk-05-01-06
void filterAdd (string $key, mixed $val, [bool $debug = FALSE])
  • string $key
  • mixed $val
  • bool $debug
filterClear (line 309)

clears the filter

  • since: pk-05-01-06
void filterClear ()
filterRemoveKey (line 343)

removes a key form the filter

  • since: pk-05-01-06
void filterRemoveKey (string $key, bool $debug)
  • string $key
  • bool $debug
getChildrenCursor (line 391)

opens a course to fetch node objects under the root (1st level)

  • since: pk-06-07-27
DB_CURSOR &getChildrenCursor ([ $filtered = False], [boolean $debug = False])
  • boolean $debug
  • $filtered
getChildrenList (line 829)

returns a array of pointers to the child objects

  • version: pk-05-01-06
  • version: pk-06-07-27
  • since: pk-04-07-23
array getChildrenList ([bool $debug = False], [bool $filtered = False])
  • bool $debug
  • bool $filtered

Redefined in descendants as:
getFilteredChildrenList (line 861)

returns a array of pointers to childs matching $myFilterArr

  • version: pk-06-07-27
  • version: pk-06-11-13 set $filtered to TRUE when calling populate
  • since: pk-05-01-06
array getFilteredChildrenList ([bool $debug = FALSE])
  • bool $debug
getGlobalTreeKey (line 144)

returns the GlobalTreeKey

  • global: $OCSP_OBJ $OCSP_OBJ:
  • global: $OCSP_VAL $OCSP_VAL:
  • version: pk-06-07-26 generate a tree key if none exists
string getGlobalTreeKey ([boolean $debug = FALSE])
  • boolean $debug
getIndexedTreeArr (line 920)

returns an array sorted as tree the index is like [1] [1.1] [1.2] [2] [2.1] ....

the value is an array with following fields: INDEX (same as index) INTEND NODE pointer to the node NODEID [NODENAME] if $nameField is set

  • version: pk-06-08-09 return array() instead of FALSE
  • since: pk-04-08-12
array getIndexedTreeArr ([DBMS_TREE_NODE $startNode = NULL], [string $startIdx = ""], [string $startIntend = ""], [string $intendStr = "&nbsp;&nbsp;"], [string $nameField = ""], [boolean $debug = FALSE])
  • DBMS_TREE_NODE $startNode
  • string $startIdx
  • string $startIntend
  • string $intendStr
  • string $nameField
  • boolean $debug
getKey (line 228)

gets a child key

mixed getKey (string $kName)
  • string $kName
getKeyTree (line 244)

returns the key tree [PARENT][ID]=>array()

  • since: pk-07-06-15
  • access: public
array getKeyTree ()
getKeyTreeNode (line 279)

returns a node in the key tree to store more information to the keytree overwrite this in

  • since: pk-07-06-16
  • access: protected
array getKeyTreeNode (array $dbRow, [boolean $debug = FALSE])
  • array $dbRow
  • boolean $debug

Redefined in descendants as:
getNode (line 697)

get a node if the

  • version: pk-06-06-20
  • version: pk-07-06-16 use global array
DBMS_TREE_NODE &getNode (int $aId, [bool $debug = FALSE])
  • int $aId
  • bool $debug

Redefined in descendants as:
getNodeDBRowFromDB (line 567)

selects a node row from the database and returns the DB Values as array with quickQuery to the database object

  • since: pk-06-07-26
array getNodeDBRowFromDB (int $aId, [boolean $debug = FALSE])
  • int $aId
  • boolean $debug
getNodeObjectFromCache (line 757)
void &getNodeObjectFromCache ( $aId, [ $debug = FALSE])
  • $aId
  • $debug
getRootId (line 195)

returns the tree root id

int getRootId ()
getRootPath (line 793)

returns an array of pointers to the elements till root with all

in case of an error false is return (use '===' type equal )

  • return: array of pointers to nodes key=DBMS_TREE_NODE::getId()
  • version: pk-05-07-25
  • version: pk-06-07-26 call the node method getRootPath()
  • version: pk-07-08-15 changed type of $aNode
array getRootPath (mixed $aNode, [bool $useCache = TRUE], [bool $debug = FALSE])
  • mixed $aNode: (DMBS_TREE_NODE) a node object or (int) a node id
  • bool $useCache
  • bool $debug

Redefined in descendants as:
getTreeArray (line 294)

returns a pointers to the global tree array

  • since: pk-04-07-23
ptr &getTreeArray (bool $debug)
  • bool $debug
newNodeObject (line 654)

generates a new child object and add it to the cache

  • version: pk-07-06-19
  • since: pk-06-07-26
DBMS_TREE_NODE &newNodeObject (int $aId, [ $dataArr = NULL], [boolean $debug = FALSE], string $aClassName)
  • int $aId: the (cache) id of the object
  • string $aClassName: if !empty $this-myChildClass is overwriten if class exists
  • boolean $debug
  • $dataArr

Redefined in descendants as:
populate (line 438)

populates the children of the tree (1st level nodes)

  • version: pk-05-07-27
  • version: pk-06-07-26
boolean populate ([bool $useCache = TRUE], [bool $debug = FALSE], [ $filtered = FALSE])
  • bool $useCache
  • bool $debug
  • $filtered

Redefined in descendants as:
populateNode (line 606)

populates a child node if $useCache the cache is checked if the node already exists if !$useCache the node is laoded from the db and the cache object is replaced

  • version: pk-06-06-20
  • version: pk-06-08-08 bugfix
DBMS_TREE_NODE &populateNode (int $aId, [bool $useCache = TRUE], [bool $debug = FALSE])
  • int $aId
  • bool $useCache
  • bool $debug

Redefined in descendants as:
populateTree (line 480)
void populateTree ([ $useCache = TRUE], [ $keysOnly = TRUE], [ $where = ""], [ $debug = FALSE])
  • $useCache
  • $keysOnly
  • $where
  • $debug

Redefined in descendants as:
setChildClassVar (line 365)

sets child class vars

void setChildClassVar ( &$child, [boolean $debug = False], &DBMS_TREE_NODE $child)
  • &DBMS_TREE_NODE $child
  • boolean $debug
  • &$child

Redefined in descendants as:
setGlobalTreeKey (line 178)

sets the GlobalTreeKey

void setGlobalTreeKey (string $aKey)
  • string $aKey
setKey (line 216)

sets a child key

void setKey (string $kName, mixed $kValue)
  • string $kName
  • mixed $kValue
setKeyTree (line 262)

sets the key tree

  • since: pk-07-06-15
  • access: public
void setKeyTree (array $treeArr)
  • array $treeArr
setRootId (line 205)

sets the tree root id

void setRootId (int $aId)
  • int $aId

Inherited Methods

Inherited From DBMS_TABLEOBJ

 DBMS_TABLEOBJ::DBMS_TABLEOBJ()
 DBMS_TABLEOBJ::cacheRestore()
 DBMS_TABLEOBJ::cacheWriteTo()
 DBMS_TABLEOBJ::clearErrors()
 DBMS_TABLEOBJ::dbDelete()
 DBMS_TABLEOBJ::dbGetDataArray()
 DBMS_TABLEOBJ::dbGetForm()
 DBMS_TABLEOBJ::dbInsert()
 DBMS_TABLEOBJ::dbPopulate()
 DBMS_TABLEOBJ::dbReplace()
 DBMS_TABLEOBJ::dbSave()
 DBMS_TABLEOBJ::db_SetKey()
 DBMS_TABLEOBJ::db_SetKeyArray()
 DBMS_TABLEOBJ::getClassInclude()
 DBMS_TABLEOBJ::getDbDesc()
 DBMS_TABLEOBJ::getDBField()
 DBMS_TABLEOBJ::getDBRow()
 DBMS_TABLEOBJ::getDBVal()
 DBMS_TABLEOBJ::getDefaults()
 DBMS_TABLEOBJ::getErrorMsg()
 DBMS_TABLEOBJ::getFieldDBDefault()
 DBMS_TABLEOBJ::getForm()
 DBMS_TABLEOBJ::getFormClassName()
 DBMS_TABLEOBJ::getFormName()
 DBMS_TABLEOBJ::getJSON()
 DBMS_TABLEOBJ::getKeyArr()
 DBMS_TABLEOBJ::getMyTable()
 DBMS_TABLEOBJ::getObjValArray()
 DBMS_TABLEOBJ::getObjValValue()
 DBMS_TABLEOBJ::getPopulateTs()
 DBMS_TABLEOBJ::getWhere()
 DBMS_TABLEOBJ::hasChanged()
 DBMS_TABLEOBJ::hasColumn()
 DBMS_TABLEOBJ::hasErrors()
 DBMS_TABLEOBJ::hasObjVals()
 DBMS_TABLEOBJ::init()
 DBMS_TABLEOBJ::isInit()
 DBMS_TABLEOBJ::isPopulated()
 DBMS_TABLEOBJ::keysAreSet()
 DBMS_TABLEOBJ::populateFromKeys()
 DBMS_TABLEOBJ::populateFromValues()
 DBMS_TABLEOBJ::populateObjVals()
 DBMS_TABLEOBJ::p_cacheIsExpired()
 DBMS_TABLEOBJ::saveLinkedRow()
 DBMS_TABLEOBJ::saveLinkedTableRows()
 DBMS_TABLEOBJ::saveObjVals()
 DBMS_TABLEOBJ::setChanged()
 DBMS_TABLEOBJ::setDBField()
 DBMS_TABLEOBJ::setDBFieldIfDiff()
 DBMS_TABLEOBJ::setDBFieldIfEmpty()
 DBMS_TABLEOBJ::setDBRow()
 DBMS_TABLEOBJ::setDBVal()
 DBMS_TABLEOBJ::setDefaults()
 DBMS_TABLEOBJ::setError()
 DBMS_TABLEOBJ::setLinkedTableRow()
 DBMS_TABLEOBJ::setMyTable()
 DBMS_TABLEOBJ::setObjValArray()
 DBMS_TABLEOBJ::setObjValValue()
 DBMS_TABLEOBJ::setObjVarIfEmpty()
 DBMS_TABLEOBJ::setUnChanged()
 DBMS_TABLEOBJ::userIsAllowed()
 DBMS_TABLEOBJ::writeDebugInfo()
 DBMS_TABLEOBJ::xmladdDOMElement()
 DBMS_TABLEOBJ::xmlExport()
 DBMS_TABLEOBJ::_getCacheFileName()
 DBMS_TABLEOBJ::_getDBFields()

Inherited From OCSP_OBJ

 OCSP_OBJ::castObj()
 OCSP_OBJ::cloneMe()
 OCSP_OBJ::currentUser()
 OCSP_OBJ::dbConnect()
 OCSP_OBJ::defaultDBObj()
 OCSP_OBJ::defaultReadDBObj()
 OCSP_OBJ::defaultWriteDBObj()
 OCSP_OBJ::getConf()
 OCSP_OBJ::getDBObj()
 OCSP_OBJ::get_myClassConstant()
 OCSP_OBJ::get_myObject_vars()
 OCSP_OBJ::get_mySourceFile()
 OCSP_OBJ::isConnected()
 OCSP_OBJ::isMultiByteStr()
 OCSP_OBJ::isUTF8()
 OCSP_OBJ::setConf()
 OCSP_OBJ::setDBObj()
 OCSP_OBJ::set_myObject_vars()
 OCSP_OBJ::set_myVarsFrom()
Class Constants

Inherited Constants

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::CLASS_SRC_FILE

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

Documentation generated on Thu, 08 Jan 2009 17:43:57 +0100 by phpDocumentor 1.4.0a2